Esempio n. 1
0
        /// <summary>
        /// Obtener Sancion por Id
        /// Autor: Jair Guerrero
        /// Fecha: 2020-08-06
        /// </summary>
        public DocumentsAM Get(long id)
        {
            try
            {
                IRepository <Documents> repo = new DocumentRepo(context);
                var sancion = repo.Get(id);

                return(mapper.Map <DocumentsAM>(sancion));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Obtener lista de Sancion
        /// Autor: Jair Guerrero
        /// Fecha: 2020-08-06
        /// </summary>
        public List <DocumentsAM> Get(Expression <Func <DocumentsAM, bool> > predicate)
        {
            try
            {
                var where = mapper.MapExpression <Expression <Func <Documents, bool> > >(predicate);

                IRepository <Documents> repo = new DocumentRepo(context);
                var sancion = repo.Get(where);

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