public List <Vendor> List(VendorSearchEntity VendorSearchEntity) { IQueryable <Vendor> Vendors = readContext.Vendors .AsNoTracking() .OrderBy(m => m.name); Vendors = Apply(Vendors, VendorSearchEntity); Vendors = SkipAndTake(Vendors, VendorSearchEntity); Vendors.OrderBy(m => m.name); return(Vendors.ToList()); }
public int Count(VendorSearchEntity VendorSearchEntity) { if (VendorSearchEntity == null) { VendorSearchEntity = new VendorSearchEntity(); } IQueryable <Vendor> Vendors = readContext.Vendors; Vendors = Apply(Vendors, VendorSearchEntity); return(Vendors.Count()); }
private IQueryable <Vendor> Apply(IQueryable <Vendor> Vendors, VendorSearchEntity VendorSearchEntity) { if (VendorSearchEntity.id.HasValue) { Vendors = Vendors.Where(wh => wh.id == VendorSearchEntity.id.Value); } if (!string.IsNullOrEmpty(VendorSearchEntity.name)) { Vendors = Vendors.Where(mc => mc.name.Contains(VendorSearchEntity.name)); } Vendors = Vendors.OrderBy(m => m.name); //if (!string.IsNullOrEmpty(VendorSearchEntity.name)) // Vendors = Vendors.Where(T => T.Code.ToLower().Contains(VendorSearchEntity.Code.ToLower())); //if (VendorSearchEntity.ParentId.HasValue) // Vendors = Vendors.Where(T => T.ParentId.HasValue && T.ParentId.Value == VendorSearchEntity.ParentId.Value); return(Vendors); }
public List <VendorEntity> Get(VendorSearchEntity VendorSearchEntity) { List <Vendor> vendors = vendorRepository.List(VendorSearchEntity); return(vendors.Select(u => new VendorEntity(u)).ToList()); }
public int Count(VendorSearchEntity VendorSearchEntity) { return(vendorRepository.Count(VendorSearchEntity)); }
public List <VendorEntity> Get(VendorSearchEntity VendorSearchEntity) { return(VendorService.Get(VendorSearchEntity)); }
public long Count(VendorSearchEntity VendorSearchEntity) { return(VendorService.Count(VendorSearchEntity)); }