コード例 #1
0
        public void AddOrder(DomOrder o)
        {
            Order newOrder = DataDomainMapper.DomOrder2Order(o);

            _db.Order.Add(newOrder);
            _db.SaveChanges();
        }
コード例 #2
0
        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();
        }