public GoodsItem Update(GoodsItem item) { var dalItem = FindById(item.Id); dalItem.Name = item.Name; dalItem.AreaId = item.AreaId; dalItem.Status = item.Status; dalItem.Shipper = item.Shipper; dalItem.LastTransition = item.LastTransition; _context.GoodsItems.Update(item); _context.SaveChanges(); return(item); }
public GoodsItem Add(GoodsItem item) { if (item.Characteristics.HumidityLow > item.Characteristics.HumidityHigh) { throw new ArgumentException("Incorrect humidity"); } if (item.Characteristics.TemperatureLow > item.Characteristics.TemperatureHigh) { throw new ArgumentException("Incorrect temperature"); } _context.Add(item); _context.SaveChanges(); return(item); }
public GoodsItem Create(GoodsItem item) { return(_repository.Add(item)); }
private GoodsItem InsertTransitionState(GoodsItem item) { item.TransitionState = GoodsStateFactory.Instance.FromGoods(item); return(item); }