public OperationResult <bool> Create(Establishment establishment)
 {
     try
     {
         if (_dao.List().Any(x => x.Address.ToLower().Trim() == establishment.Address.ToLower().Trim() && !x.IsDeleted))
         {
             return new OperationResult <bool>()
                    {
                        Success = true, Result = false, Message = "Address already exists"
                    }
         }
         ;
         _dao.Create(establishment);
         return(new OperationResult <bool>()
         {
             Success = true, Result = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult <bool>()
         {
             Success = false, Exception = e
         });
     }
 }
Exemple #2
0
 public OperationResult Create(Establishment establishment)
 {
     try
     {
         _dao.Create(establishment);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }