/// <summary> /// Obtener cantidad de registros de PersonServices /// Autor: Jair Guerrero /// Fecha: 2021-02-20 /// </summary> public int Count() { try { IRepository <PersonServices> repo = new PersonServicesRepo(context); return(repo.Count()); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }
/// <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); } }
/// <summary> /// Obtener cantidad de registros de PersonServices según filtro /// Autor: Jair Guerrero /// Fecha: 2021-02-20 /// </summary> public int Count(Expression <Func <PersonServicesAM, bool> > predicate) { try { var where = mapper.MapExpression <Expression <Func <PersonServices, bool> > >(predicate); IRepository <PersonServices> repo = new PersonServicesRepo(context); return(repo.Count(where)); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }
/// <summary> /// Crear registro de PersonServices /// Autor: Jair Guerrero /// Fecha: 2021-02-20 /// </summary> public long Create(PersonServicesAM entity) { try { var PersonServices = mapper.Map <PersonServices>(entity); IRepository <PersonServices> repo = new PersonServicesRepo(context); return(repo.Create(PersonServices)); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }