Пример #1
0
        public static Shelf Create(string name, Room room)
        {
            var shelf = new Shelf()
            {
                Name = name
            };

            room.Shelves.Add(shelf);
            return(shelf);
        }
Пример #2
0
        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);
        }