public void Update(StagedItem stagedItem) { var toUpdate = db.StagedItems.Single(x => x.UPC == stagedItem.UPC); toUpdate.ItemPrice = stagedItem.ItemPrice; toUpdate.StockCount = stagedItem.StockCount; db.SaveChanges(); }
public StagedItem Get(StagedItem item) { return db.StagedItems.Find(item.ID); }
public void Destroy(StagedItem stagedItem) { Destroy(stagedItem.UPC); }
public void Create(StagedItem item) { db.StagedItems.Add(item); db.SaveChanges(); }
private StagedItemDTO EntityToDTOMapper(StagedItem entity) { return new StagedItemDTO { ID = entity.ID, ItemPrice = entity.ItemPrice, Name = CleanName(entity.Name), UPC = entity.UPC, StockCount = entity.StockCount }; }
private StagedItemsViewModel ConvertEntityToViewModel(StagedItem entity) { return new StagedItemsViewModel { ItemPrice = entity.ItemPrice.AsCurrency(), Name = entity.Name, StockCount = entity.StockCount, UPC = entity.UPC }; }