public OperationResult Create(Serving item)
 {
     try
     {
         _dao.Create(item);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
예제 #2
0
 public virtual OperationResult Create(Serving serving)
 {
     try
     {
         using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled);
         _dao.Create(serving);
         transactionScope.Complete();
         return(new OperationResult <List <Serving> > {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult <List <Serving> >()
         {
             Success = false, Exception = e
         });
     }
 }