32 lines
836 B
C#
32 lines
836 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Project.Domain.Entities
|
|
{
|
|
[Table("PRODUCT", Schema = "dbo")]
|
|
public class Product
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
[Column("ID")]
|
|
public int Id { get; set; } = 0;
|
|
|
|
[Required]
|
|
[Column("PRODUCT_NAME")]
|
|
public string Name { get; set; }
|
|
|
|
[Required]
|
|
[Column("PRICE", TypeName = "decimal(18,2)")]
|
|
public decimal Price { get; set; }
|
|
|
|
public int CategoryId { get; set; }
|
|
|
|
[ForeignKey("CategoryId")]
|
|
[Column("PRODUCT_CATEGORY")]
|
|
public Category? Category { get; set; }
|
|
|
|
[Column("QUANTITY")]
|
|
public int Quantity { get; set; }
|
|
}
|
|
}
|