public void AddOrder(DomOrder o) { Order newOrder = DataDomainMapper.DomOrder2Order(o); _db.Order.Add(newOrder); _db.SaveChanges(); }
public void RemoveOrder(DomOrder o) { Order remOrder = DataDomainMapper.DomOrder2Order(o); Pizza[] pizzas = _db.Pizza.Where(p => p.OrderId == remOrder.Id).ToArray(); _db.Pizza.RemoveRange(pizzas); _db.Order.Remove(remOrder); _db.SaveChanges(); }