Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NorthwindCRUD/Models/Contracts/IProduct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public interface IProduct
{
int ProductId { get; set; }

string ProductName { get; set; }

int? SupplierId { get; set; }

int? CategoryId { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions NorthwindCRUD/Models/DbModels/ProductDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class ProductDb : IProduct
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int ProductId { get; set; }

[MaxLength(40)]
public string ProductName { get; set; }

public int? SupplierId { get; set; }

public SupplierDb? Supplier { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions NorthwindCRUD/Models/Dtos/ProductDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public class ProductDto : IProduct
{
public int ProductId { get; set; }

[StringLength(40, ErrorMessage = "ProductName cannot exceed 40 characters.")]
public string ProductName { get; set; }

[Range(1, int.MaxValue, ErrorMessage = "SupplierId must be a valid supplier ID.")]
public int? SupplierId { get; set; }

Expand Down
Loading