using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Threading.Tasks; namespace ACG6MvcAdHcApi.Models { /// <summary> /// Works like the Base class for Product model class. /// ************************************* Do not make changes to this class ************************************* /// ** Put your additional code in the Product model class under the Models folder. ** /// ************************************************************************************************************* /// </summary> public partial class Product { /// <summary> /// Gets or Sets ProductID /// </summary> [Display(Name = "Product ID")] public int ProductID { get; set; } /// <summary> /// Gets or Sets ProductName /// </summary> [Required(ErrorMessage = "{0} is required!")] [StringLength(40, ErrorMessage = "{0} must be a maximum of {1} characters long!")] [Display(Name = "Product Name")] public string ProductName { get; set; } /// <summary> /// Gets or Sets SupplierID /// </summary> [Display(Name = "Supplier ID")] public int? SupplierID { get; set; } /// <summary> /// Gets or Sets CategoryID /// </summary> [Display(Name = "Category ID")] public int? CategoryID { get; set; } /// <summary> /// Gets or Sets QuantityPerUnit /// </summary> [StringLength(20, ErrorMessage = "{0} must be a maximum of {1} characters long!")] [Display(Name = "Quantity Per Unit")] public string QuantityPerUnit { get; set; } /// <summary> /// Gets or Sets UnitPrice /// </summary> [RegularExpression(@"[-+]?[0-9]*\.?[0-9]?[0-9]", ErrorMessage = "{0} must be a valid decimal!")] [Display(Name = "Unit Price")] public decimal? UnitPrice { get; set; } /// <summary> /// Gets or Sets UnitsInStock /// </summary> [Range(typeof(Int16), "-32768", "32767", ErrorMessage = "{0} must be an integer!")] [Display(Name = "Units In Stock")] public Int16? UnitsInStock { get; set; } [NotMapped] [RegularExpression("([0-9]+)", ErrorMessage = "{0} must be a number!")] [Range(typeof(Int16), "-32768", "32767", ErrorMessage = "{0} must be between {1} and {2}")] [Display(Name = "Units In Stock")] public string UnitsInStockHidden { get; set; } /// <summary> /// Gets or Sets UnitsOnOrder /// </summary> [Range(typeof(Int16), "-32768", "32767", ErrorMessage = "{0} must be an integer!")] [Display(Name = "Units On Order")] public Int16? UnitsOnOrder { get; set; } [NotMapped] [RegularExpression("([0-9]+)", ErrorMessage = "{0} must be a number!")] [Range(typeof(Int16), "-32768", "32767", ErrorMessage = "{0} must be between {1} and {2}")] [Display(Name = "Units On Order")] public string UnitsOnOrderHidden { get; set; } /// <summary> /// Gets or Sets ReorderLevel /// </summary> [Range(typeof(Int16), "-32768", "32767", ErrorMessage = "{0} must be an integer!")] [Display(Name = "Reorder Level")] public Int16? ReorderLevel { get; set; } [NotMapped] [RegularExpression("([0-9]+)", ErrorMessage = "{0} must be a number!")] [Range(typeof(Int16), "-32768", "32767", ErrorMessage = "{0} must be between {1} and {2}")] [Display(Name = "Reorder Level")] public string ReorderLevelHidden { get; set; } /// <summary> /// Gets or Sets Discontinued /// </summary> [Required(ErrorMessage = "{0} is required!")] [Display(Name = "Discontinued")] public bool Discontinued { get; set; } /// <summary> /// Gets or sets the Related Suppliers. Related to column SupplierID /// </summary> public Supplier Supplier { get; set; } /// <summary> /// Gets or sets the Related Categories. Related to column CategoryID /// </summary> public Category Category { get; set; } } }