public int RemoveFromCart(Itemdto item) { var item1 = item.MappingtoItem(); var shopping2 = shopping.RemoveFromCart(item1); return(shopping2); }
public static void MappingtoItem(this Itemdto itemdto, Item item) { item.ItemId = itemdto.ItemId; item.Name = itemdto.Name; item.shortDescription = itemdto.shortDescription; item.LongDescription = itemdto.LongDescription; item.AllergyInformation = itemdto.AllergyInformation; item.Price = itemdto.Price; item.ImageUrl = itemdto.ImageUrl; item.ImageThumbnailUrl = itemdto.ImageThumbnailUrl; item.isItemOfTheWeek = itemdto.isItemOfTheWeek; item.InStock = itemdto.InStock; item.CategoryId = itemdto.CategoryId; }
public static Item MappingtoItem(this Itemdto itemdto) { return(new Item { ItemId = itemdto.ItemId, Name = itemdto.Name, shortDescription = itemdto.shortDescription, LongDescription = itemdto.LongDescription, AllergyInformation = itemdto.AllergyInformation, Price = itemdto.Price, ImageUrl = itemdto.ImageUrl, ImageThumbnailUrl = itemdto.ImageThumbnailUrl, isItemOfTheWeek = itemdto.isItemOfTheWeek, InStock = itemdto.InStock, CategoryId = itemdto.CategoryId }); }
public void AddToCart(Itemdto item, int amount) { var item1 = item.MappingtoItem(); shopping.AddToCart(item1, amount); }