public async Task <IEnumerable <SelectItemVM <int> > > GetValidSupplierByNemotecnicoToView(string nemotecnico) { return(await _dbContext.Supplier.Where(x => x.IsActive.Equals(true) && x.ProductType.Nemotecnico.Equals(nemotecnico)) .Select(x => SelectItemVM <int> .Create(x.Id, x.Name)) .ToListAsync()); }
public async Task <IEnumerable <SelectItemVM <int> > > GetValueByNemotecnic(string nemotecnico) { return(await _applicationDbContext.Set <T>() .Where(x => x.Nemotecnico.Equals(nemotecnico)) .Select(x => SelectItemVM <int> .Create(x.Id, x.ShortDesc)) .ToListAsync()); }
public async Task <IEnumerable <SelectItemVM <int> > > GetGeneralEntityValidData() { return(await _applicationDbContext.Set <T>() .Where(x => x.IsActive.Equals(true)) .Select(x => SelectItemVM <int> .Create(x.Id, x.ShortDesc)) .ToListAsync()); }
public async Task <IEnumerable <SelectItemVM <int> > > GetValidEstatesByPersonId(int id) { return(await _dbContext.PersonsByEstate.Where(x => x.PersonId.Equals(id)) .Include(x => x.Estate) .Select(x => SelectItemVM <int> .Create(x.EstateId, x.Estate.Alias)) .ToListAsync()); }
public async Task <IEnumerable <SelectItemVM <int> > > GetValidWaterMeterToView() { var data = await _dbContext.WaterMeter.Where(x => x.IsActive.Equals(true)) .Select(x => SelectItemVM <int> .Create(x.Id, x.SerialNumber)) .ToListAsync(); return(data); }
public async Task <List <SelectItemVM <int> > > GetValidData() { return(await _dbContext.Contract.Include(x => x.PersonsByEstate) .ThenInclude(x => x.Estate) .Include(x => x.PersonsByEstate) .ThenInclude(x => x.Person) .Include(x => x.Meter) .Where(x => x.IsActive.Equals(true)) .Select(x => SelectItemVM <int> .Create(x.Id, $"{x.PersonsByEstate.Person.FullName} / {x.PersonsByEstate.Estate.Alias} / {x.Meter.SerialNumber}")) .ToListAsync()); }
public new static SelectItemVM <int> Create(int value, string text) { return(SelectItemVM <int> .Create(value, text)); }