|
1 | 1 | namespace NorthwindCRUD.Models.Dtos |
2 | 2 | { |
3 | 3 | using NorthwindCRUD.Models.Contracts; |
| 4 | + using Swashbuckle.AspNetCore.Annotations; |
4 | 5 | using System.ComponentModel.DataAnnotations; |
5 | 6 |
|
6 | 7 | public class EmployeeDto : IEmployee |
7 | 8 | { |
| 9 | + [SwaggerSchema("Number automatically assigned to new employee.")] |
| 10 | + [MinLength(8)] // Min length comes from IdGenerator.CreateDigitsId |
| 11 | + [Required] |
8 | 12 | public int EmployeeId { get; set; } |
9 | 13 |
|
| 14 | + [SwaggerSchema("Employee's last name.")] |
10 | 15 | public string LastName { get; set; } |
11 | 16 |
|
| 17 | + [SwaggerSchema("Employee's first name.")] |
12 | 18 | public string FirstName { get; set; } |
13 | 19 |
|
| 20 | + [SwaggerSchema("Employee's title")] |
14 | 21 | public string Title { get; set; } |
15 | 22 |
|
| 23 | + [SwaggerSchema("Title used in salutations")] |
16 | 24 | public string TitleOfCourtesy { get; set; } |
17 | 25 |
|
| 26 | + [SwaggerSchema("Employee's birth date", Format = "date")] |
18 | 27 | public string BirthDate { get; set; } |
19 | 28 |
|
| 29 | + [SwaggerSchema("Employee's hire date", Format = "date")] |
20 | 30 | public string HireDate { get; set; } |
21 | 31 |
|
22 | 32 | public string AddressId { get; set; } |
23 | 33 |
|
24 | 34 | public AddressDto Address { get; set; } |
25 | | - |
| 35 | + |
| 36 | + [SwaggerSchema("General information about employee's background.")] |
26 | 37 | public string Notes { get; set; } |
27 | 38 |
|
| 39 | + [SwaggerSchema("Employee's avatar url.", Format = "uri")] |
28 | 40 | public string AvatarUrl { get; set; } |
29 | 41 |
|
| 42 | + [SwaggerSchema("Employee's supervisor.")] |
30 | 43 | public int ReportsTo { get; set; } |
31 | 44 | } |
32 | 45 | } |
0 commit comments