Beispiel #1
0
        /// <summary>
        /// Obtener services por Id
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public ServicesAM Get(long id)
        {
            try
            {
                IRepository <Services> repo = new ServicesRepo(context);
                var services = repo.Get(id);

                return(mapper.Map <ServicesAM>(services));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Obtener lista de services
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public List <ServicesAM> Get(Expression <Func <ServicesAM, bool> > predicate)
        {
            try
            {
                var where = mapper.MapExpression <Expression <Func <Services, bool> > >(predicate);

                IRepository <Services> repo = new ServicesRepo(context);
                var services = repo.Get(where);

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