Exemple #1
0
        /// <summary>
        /// Obtener PersonServices por Id
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public PersonServicesAM Get(long id)
        {
            try
            {
                IRepository <PersonServices> repo = new PersonServicesRepo(context);
                var PersonServices = repo.Get(id);

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

                IRepository <PersonServices> repo = new PersonServicesRepo(context);
                var PersonServices = repo.Get(where);

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