Example #1
0
        /// <summary>
        /// Obtener Sancion por Id
        /// Autor: Jair Guerrero
        /// Fecha: 2020-08-06
        /// </summary>
        public IdentificationTypeAM Get(long id)
        {
            try
            {
                IRepository <IdentificationType> repo = new IdentificationTypeRepo(context);
                var sancion = repo.Get(id);

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

                IRepository <IdentificationType> repo = new IdentificationTypeRepo(context);
                var sancion = repo.Get(where);

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