Exemplo n.º 1
0
 public bool Add(OrderTypeModifyModel entity)
 {
     using (var repository = _sourceFactory.CreateRepository <OrderType, int>())
     {
         return(repository.Add(new OrderType
         {
             OrderTypeName = entity.OrderTypeName
         }));
     };
 }
Exemplo n.º 2
0
        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));
            }
        }