public bool Add(OrderTypeModifyModel entity) { using (var repository = _sourceFactory.CreateRepository <OrderType, int>()) { return(repository.Add(new OrderType { OrderTypeName = entity.OrderTypeName })); }; }
public bool Update(int id, OrderTypeModifyModel entity) { using (var repository = _sourceFactory.CreateRepository <OrderType, int>()) { var orderType = repository.GetSingle(id); if (orderType == null) { throw new NotFoundException(); } orderType.OrderTypeName = entity.OrderTypeName; return(repository.Update(orderType)); } }