コード例 #1
0
ファイル: StatesBO.cs プロジェクト: jaiguers/document_manager
        /// <summary>
        /// Obtener primera Sancion según filtro
        /// Autor: Jair Guerrero
        /// Fecha: 2020-12-05
        /// </summary>
        public StatesAM GetFirst(Expression <Func <StatesAM, bool> > predicate)
        {
            try
            {
                var where = mapper.MapExpression <Expression <Func <States, bool> > >(predicate);

                IRepository <States> repo = new StatesRepo(context);
                var sancion = repo.GetFirst(where);

                return(mapper.Map <StatesAM>(sancion));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }