public static Shelf Create(string name, Room room) { var shelf = new Shelf() { Name = name }; room.Shelves.Add(shelf); return(shelf); }
public ProductInstance AddInstance(Shelf shelf, AddProductInstanceRequest info) { var newInstance = new ProductInstance { Product = this, Shelf = shelf, Amount = info.Amount, AmountUnit = info.AmountUnit, ExpirationDate = info.ExpirationDate }; Instances.Add(newInstance); return(newInstance); }