Skip to content

Commit 32b3ca2

Browse files
fix(*): return datatype attribute to dtos
1 parent 0d72aa7 commit 32b3ca2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NorthwindCRUD/Models/Dtos/EmployeeDto.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ public class EmployeeDto : IEmployee
2222
[SwaggerSchema("Title used in salutations")]
2323
public string TitleOfCourtesy { get; set; }
2424

25+
[DataType(DataType.Date, ErrorMessage = "BirthDate must be a valid date.")]
2526
[SwaggerSchema("Employee's birth date")]
2627
public string BirthDate { get; set; }
2728

29+
[DataType(DataType.Date, ErrorMessage = "HireDate must be a valid date.")]
2830
[SwaggerSchema("Employee's hire date")]
2931
public string HireDate { get; set; }
3032

NorthwindCRUD/Models/Dtos/OrderDto.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ public class OrderDto : IOrder
1515

1616
public int ShipperId { get; set; }
1717

18+
[DataType(DataType.Date, ErrorMessage = "OrderDate must be a valid date.")]
1819
public string OrderDate { get; set; }
1920

21+
[DataType(DataType.Date, ErrorMessage = "RequiredDate must be a valid date.")]
2022
public string RequiredDate { get; set; }
2123

2224
public Shipping? ShipVia { get; set; }

0 commit comments

Comments
 (0)