/// <summary>
 /// Initializes a new instance of the <see cref="Products" /> class.
 /// </summary>
 /// <param name="ProductId">ProductId.</param>
 /// <param name="ProductName">ProductName (required).</param>
 /// <param name="SupplierId">SupplierId.</param>
 /// <param name="CategoryId">CategoryId.</param>
 /// <param name="QuantityPerUnit">QuantityPerUnit.</param>
 /// <param name="UnitPrice">UnitPrice.</param>
 /// <param name="UnitsInStock">UnitsInStock.</param>
 /// <param name="UnitsOnOrder">UnitsOnOrder.</param>
 /// <param name="ReorderLevel">ReorderLevel.</param>
 /// <param name="Discontinued">Discontinued.</param>
 /// <param name="Category">Category.</param>
 /// <param name="Supplier">Supplier.</param>
 /// <param name="OrderDetails">OrderDetails.</param>
 public Products(int?ProductId = default(int?), string ProductName = default(string), int?SupplierId = default(int?), int?CategoryId = default(int?), string QuantityPerUnit = default(string), double?UnitPrice = default(double?), int?UnitsInStock = default(int?), int?UnitsOnOrder = default(int?), int?ReorderLevel = default(int?), bool?Discontinued = default(bool?), Categories Category = default(Categories), Suppliers Supplier = default(Suppliers), List <OrderDetails> OrderDetails = default(List <OrderDetails>))
 {
     // to ensure "ProductName" is required (not null)
     if (ProductName == null)
     {
         throw new InvalidDataException("ProductName is a required property for Products and cannot be null");
     }
     else
     {
         this.ProductName = ProductName;
     }
     this.ProductId       = ProductId;
     this.SupplierId      = SupplierId;
     this.CategoryId      = CategoryId;
     this.QuantityPerUnit = QuantityPerUnit;
     this.UnitPrice       = UnitPrice;
     this.UnitsInStock    = UnitsInStock;
     this.UnitsOnOrder    = UnitsOnOrder;
     this.ReorderLevel    = ReorderLevel;
     this.Discontinued    = Discontinued;
     this.Category        = Category;
     this.Supplier        = Supplier;
     this.OrderDetails    = OrderDetails;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Products" /> class.
 /// </summary>
 /// <param name="productId">productId (required).</param>
 /// <param name="productName">productName (required).</param>
 /// <param name="supplierId">supplierId (required).</param>
 /// <param name="categoryId">categoryId (required).</param>
 /// <param name="quantityPerUnit">quantityPerUnit.</param>
 /// <param name="unitPrice">unitPrice.</param>
 /// <param name="unitsInStock">unitsInStock.</param>
 /// <param name="unitsOnOrder">unitsOnOrder.</param>
 /// <param name="reorderLevel">reorderLevel.</param>
 /// <param name="discontinued">discontinued (required).</param>
 /// <param name="category">category.</param>
 /// <param name="supplier">supplier.</param>
 /// <param name="orderDetails">orderDetails.</param>
 public Products(int?productId = default(int?), string productName = default(string), int?supplierId = default(int?), int?categoryId = default(int?), string quantityPerUnit = default(string), decimal?unitPrice = default(decimal?), int?unitsInStock = default(int?), int?unitsOnOrder = default(int?), int?reorderLevel = default(int?), bool?discontinued = default(bool?), Categories category = default(Categories), Suppliers supplier = default(Suppliers), List <OrderDetails> orderDetails = default(List <OrderDetails>))
 {
     // to ensure "productId" is required (not null)
     if (productId == null)
     {
         throw new InvalidDataException("productId is a required property for Products and cannot be null");
     }
     else
     {
         this.ProductId = productId;
     }
     // to ensure "productName" is required (not null)
     if (productName == null)
     {
         throw new InvalidDataException("productName is a required property for Products and cannot be null");
     }
     else
     {
         this.ProductName = productName;
     }
     // to ensure "supplierId" is required (not null)
     if (supplierId == null)
     {
         throw new InvalidDataException("supplierId is a required property for Products and cannot be null");
     }
     else
     {
         this.SupplierId = supplierId;
     }
     // to ensure "categoryId" is required (not null)
     if (categoryId == null)
     {
         throw new InvalidDataException("categoryId is a required property for Products and cannot be null");
     }
     else
     {
         this.CategoryId = categoryId;
     }
     // to ensure "discontinued" is required (not null)
     if (discontinued == null)
     {
         throw new InvalidDataException("discontinued is a required property for Products and cannot be null");
     }
     else
     {
         this.Discontinued = discontinued;
     }
     this.QuantityPerUnit = quantityPerUnit;
     this.UnitPrice       = unitPrice;
     this.UnitsInStock    = unitsInStock;
     this.UnitsOnOrder    = unitsOnOrder;
     this.ReorderLevel    = reorderLevel;
     this.Category        = category;
     this.Supplier        = supplier;
     this.OrderDetails    = orderDetails;
 }