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

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

                IRepository <RolMenu> repo = new RolMenuRepo(context);
                var sancion = repo.Get(where);

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