コード例 #1
0
ファイル: StatesBO.cs プロジェクト: jaiguers/document_manager
 /// <summary>
 /// Obtener cantidad de registros de Sancion
 /// Autor: Jair Guerrero
 /// Fecha: 2020-12-05
 /// </summary>
 public int Count()
 {
     try
     {
         IRepository <States> repo = new StatesRepo(context);
         return(repo.Count());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex.InnerException);
     }
 }
コード例 #2
0
ファイル: StatesBO.cs プロジェクト: jaiguers/document_manager
        /// <summary>
        /// Obtener cantidad de registros de Sancion según filtro
        /// Autor: Jair Guerrero
        /// Fecha: 2020-12-05
        /// </summary>
        public int Count(Expression <Func <StatesAM, bool> > predicate)
        {
            try
            {
                var where = mapper.MapExpression <Expression <Func <States, bool> > >(predicate);

                IRepository <States> repo = new StatesRepo(context);
                return(repo.Count(where));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }