private async void TxtPretraga_TextChanged(object sender, EventArgs e) { var search = new UredSearchRequest { Naziv = txtPretraga.Text }; var result = await _aPIService.Get <List <Model.Ured> >(search); dgvUred.DataSource = result; }
public List <Ured> Get(UredSearchRequest request) { var query = _context.Uredi.AsQueryable(); if (!string.IsNullOrWhiteSpace(request?.Naziv)) { query = query.Where(x => x.Naziv.StartsWith(request.Naziv)); } query = query.Where(p => p.IsDeleted == false); var list = query.ToList(); return(_mapper.Map <List <Model.Ured> >(list)); }
public List <Model.Ured> Get([FromQuery] UredSearchRequest request) { return(_uredService.Get(request)); }