/// <summary> /// Persist the details /// </summary> /// <param name="details">Some delivery details that need saving</param> public void SaveDeliveryDetails(DeliveryDetailsDomain details) { using (DeliveryContext context = new DeliveryContext()) { DeliveryDetails detailsToSave = new DeliveryDetails { Name = details.Name, Address = details.Address, Phone = details.Phone }; DeliveryStore dataStore = new DeliveryStore(context); dataStore.SaveDeliveryDetails(detailsToSave); context.SaveChanges(); } }
public void SaveDeliveryDetails(DeliveryDetails details) { context.Deliveries.Add(details); context.SaveChanges(); }