示例#1
0
        public bool AddOrder(OrderModel orderModel)
        {
            using (var work = new ErrandsUnitOfWork())
            {
                work.GetRepository <OrderModel>().Insert(orderModel);

                work.Commit();
            }

            return(true);
        }
示例#2
0
        public bool AddCoordinateToOrder(int orderId, Coordinate coordinate)
        {
            using (var work = new ErrandsUnitOfWork())
            {
                var order = work.GetRepository <OrderModel>().Get(orderId);

                if (order == null)
                {
                    return(false);
                }

                order.Coordinates.Add(coordinate);

                work.Commit();
            }

            return(true);
        }