public virtual void SetProductItemDetails(ProductItemDetails productItemDetails) { if (CanSetProductItemDetails(productItemDetails) != string.Empty) { throw new InvalidOperationException(); } this.productItemDetails = productItemDetails; }
private string CanSetProductItemDetails(ProductItemDetails productItemDetails) { if (productItemDetails.Product_Description.Any(x => x > 255)) { return("Product Description must have Unicode Characters"); } if (productItemDetails.Other_Details.Length > 120) { return("Other Details must be less than 120 Characters"); } return(string.Empty); }
public Product() { productInventoryDetails = NoneInventoryDetails; productItemDetails = NoneItemDetails; }