public OperationResult Create(StaffTitle staffTitle)
 {
     try
     {
         _dao.Create(staffTitle);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
Ejemplo n.º 2
0
 public virtual OperationResult Create(StaffTitle staffTitle)
 {
     try
     {
         using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled);
         _dao.Create(staffTitle);
         transactionScope.Complete();
         return(new OperationResult <List <StaffTitle> > {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult <List <StaffTitle> >()
         {
             Success = false, Exception = e
         });
     }
 }