Skip to content

Commit 3db9f6a

Browse files
committed
ProductName added
1 parent c22519b commit 3db9f6a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

NorthwindCRUD/Models/Contracts/IProduct.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public interface IProduct
44
{
55
int ProductId { get; set; }
66

7+
string ProductName { get; set; }
8+
79
int? SupplierId { get; set; }
810

911
int? CategoryId { get; set; }

NorthwindCRUD/Models/DbModels/ProductDb.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ public class ProductDb : IProduct
1010
[DatabaseGenerated(DatabaseGeneratedOption.None)]
1111
public int ProductId { get; set; }
1212

13+
[MaxLength(40)]
14+
public string ProductName { get; set; }
15+
1316
public int? SupplierId { get; set; }
1417

1518
public SupplierDb? Supplier { get; set; }

NorthwindCRUD/Models/Dtos/ProductDto.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ public class ProductDto : IProduct
77
{
88
public int ProductId { get; set; }
99

10+
[StringLength(40, ErrorMessage = "ProductName cannot exceed 40 characters.")]
11+
public string ProductName { get; set; }
12+
1013
[Range(1, int.MaxValue, ErrorMessage = "SupplierId must be a valid supplier ID.")]
1114
public int? SupplierId { get; set; }
1215

0 commit comments

Comments
 (0)