Ejemplo n.º 1
0
 public UserEntity GetUserEntityByLogin(string login)
 {
     try
     {
         var exprCreater = new ExpressionCreater<DalUser>();
         return
             _userRepository.GetByPredicate(
                 exprCreater.GetExpression(new[] {new KeyValuePair<string, object>("Login", login)}))?
                 .ToBllUser();
         //_userRepository.GetUserByLogin(login)?.ToBllUser();
     }
     catch (Exception e)
     {
         Log.LogError(e);
         return null;
     }
 }
Ejemplo n.º 2
0
 public UserEntity GetUserEntityByLogin(string login)
 {
     try
     {
         var exprCreater = new ExpressionCreater <DalUser>();
         return
             (_userRepository.GetByPredicate(
                  exprCreater.GetExpression(new[] { new KeyValuePair <string, object>("Login", login) }))?
              .ToBllUser());
         //_userRepository.GetUserByLogin(login)?.ToBllUser();
     }
     catch (Exception e)
     {
         Log.LogError(e);
         return(null);
     }
 }
Ejemplo n.º 3
0
 public CategoryEntity GetByCategoryName(string name)
 {
     try
     {
         var creater = new ExpressionCreater <DalCategory>();
         var query   = creater.GetExpression(new[]
         {
             new KeyValuePair <string, object>("CategoryName", name)
         });
         var res = _categoryRepository.GetByPredicate(query);
         return(res?.ToBllCategory());
     }
     catch (Exception e)
     {
         Log.LogError(e);
         return(null);
     }
 }
Ejemplo n.º 4
0
        public IEnumerable <LotEntity> GetActiveLots()
        {
            var creater = new ExpressionCreater <DalLot>();

            try
            {
                var query = creater.GetExpression(new[]
                {
                    new KeyValuePair <string, object>("IsConfirm", true),
                    new KeyValuePair <string, object>("IsBlocked", false)
                });
                var result = _lotRepository.GetByPredicateMany(query);
                return(result.Select(t => t.ToLotEntity()));
            }
            catch (Exception e)
            {
                Log.LogError(e);
                return(new List <LotEntity>());
            }
        }
Ejemplo n.º 5
0
 public IEnumerable<LotEntity> GetActiveLots()
 {
     var creater = new ExpressionCreater<DalLot>();
     try
     {
         var query = creater.GetExpression(new[]
         {
             new KeyValuePair<string, object>("IsConfirm", true),
             new KeyValuePair<string, object>("IsBlocked", false)
         });
         var result = _lotRepository.GetByPredicateMany(query);
         return result.Select(t => t.ToLotEntity());
     }
     catch (Exception e)
     {
         Log.LogError(e);
         return new List<LotEntity>();
     }
 }
Ejemplo n.º 6
0
 public CategoryEntity GetByCategoryName(string name)
 {
     try
     {
         var creater = new ExpressionCreater<DalCategory>();
         var query = creater.GetExpression(new[]
         {
             new KeyValuePair<string, object>("CategoryName", name)
         });
         var res = _categoryRepository.GetByPredicate(query);
         return res?.ToBllCategory();
     }
     catch (Exception e)
     {
         Log.LogError(e);
         return null;
     }
 }