public bool AddOrder(OrderModel orderModel) { using (var work = new ErrandsUnitOfWork()) { work.GetRepository <OrderModel>().Insert(orderModel); work.Commit(); } return(true); }
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); }