Exemple #1
0
 protected override IEnumerable <UserInfoModel> GetData <UserInfoModel>()
 {
     try
     {
         using (var conn = connectionFactory.CreateConnection())
         {
             if (conn.State == System.Data.ConnectionState.Closed)
             {
                 conn.Open();
             }
             var data = conn.GetAll <UsersInfoEntity>().Where(q => q.ActivationStatus == ActivationStatusEnum.Active.ToInt());
             if (data != null && data.Any())
             {
                 return(Mapper.Map <IEnumerable <UsersInfoEntity>, IEnumerable <UserInfoModel> >(data));
             }
             else
             {
                 return(null);
             }
         }
     }
     catch (Exception ex)
     {
         var methotName = MethodBase.GetCurrentMethod().GetMethodName();
         logger.AddFattalLog(methotName, ExceptionMessageHelper.UnexpectedCacheError, "", ex);
         throw new KnownException(ErrorTypeEnum.CahceGeneralException, methotName, ex);
     }
 }