public int Count(CountrySearchEntity SearchCountryEntity) { if (SearchCountryEntity == null) { SearchCountryEntity = new CountrySearchEntity(); } IQueryable <Country> Countries = context.Countries; Apply(Countries, SearchCountryEntity); return(Countries.Count()); }
public List <Country> List(CountrySearchEntity SearchCountryEntity) { if (SearchCountryEntity == null) { SearchCountryEntity = new CountrySearchEntity(); } IQueryable <Country> Countries = context.Countries .Include(c => c.Cities) .Include(c => c.Taxes).ThenInclude(t => t.Category); Apply(Countries, SearchCountryEntity); SkipAndTake(Countries, SearchCountryEntity); return(Countries.ToList()); }
private IQueryable <Country> Apply(IQueryable <Country> Countries, CountrySearchEntity SearchCountryEntity) { if (SearchCountryEntity.Id.HasValue) { Countries = Countries.Where(wh => wh.Id == SearchCountryEntity.Id.Value); } if (!string.IsNullOrEmpty(SearchCountryEntity.Code)) { Countries = Countries.Where(T => T.Code.ToLower().Contains(SearchCountryEntity.Code.ToLower())); } if (!string.IsNullOrEmpty(SearchCountryEntity.Name)) { Countries = Countries.Where(T => T.Name.ToLower().Contains(SearchCountryEntity.Name.ToLower())); } if (!string.IsNullOrEmpty(SearchCountryEntity.Note)) { Countries = Countries.Where(T => T.Note.ToLower().Contains(SearchCountryEntity.Note.ToLower())); } return(Countries); }
public List <CountryEntity> Get(EmployeeEntity EmployeeEntity, CountrySearchEntity CountrySearchEntity) { List <Country> Countrys = UnitOfWork.CountryRepository.List(CountrySearchEntity); return(Countrys.ToList().Select(c => new CountryEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, CountrySearchEntity CountrySearchEntity) { return(UnitOfWork.CountryRepository.Count(CountrySearchEntity)); }
public List <CountryEntity> Get(CountrySearchEntity SearchCountryEntity) { return(CountryService.Get(EmployeeEntity, SearchCountryEntity)); }
public long Count(CountrySearchEntity SearchCountryEntity) { return(CountryService.Count(EmployeeEntity, SearchCountryEntity)); }