public IList <PersonListModel> GetAll() { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { return(dbContext.People .Select(e => PersonMapper.MapPersonEntityToListModel(e)) .ToList()); } }
public PersonListModel GetByIdListModel(Guid id) { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { var entity = dbContext.People.FirstOrDefault(t => t.Id == id); if (entity == null) { return(null); } return(PersonMapper.MapPersonEntityToListModel(entity)); } }