public static Entities.Stores MapStore(YourStore.Library.Store st) { Entities.Stores stor = new Entities.Stores(); stor.StoreName = st.Name; stor.Id = st.StoreID; stor.Zip = st.Zip; /* foreach (YourStore.Library.Products p in st.ItemInventory.Keys) * { * * Entities.Products products = Mapper.MapProduct(p); * Entities.Inventories x = new Entities.Inventories(); * x.Product = products; * x.Quantity = st.ItemInventory[p]; * stor.Inventories.Add(x); * * }*/ return(stor); }
/// <summary> /// My class library does not have an inventory. Therefore i will return the product and the quanity using the out keyword /// </summary> /// <param name="inv"></param> /// <param name="quantities"></param> /// <returns></returns> public static YourStore.Library.Product MapInven(Entities.Inventories inv, out int quantities, out YourStore.Library.Store store) //old code { quantities = inv.Quantity; store = MapStore((inv.Store)); return(MapProduct(inv.Product)); }