private async void btnSearchPerformer_Click(object sender, EventArgs e) { PerformerSearchRequest searchObj = new PerformerSearchRequest { Name = txtboxName.Text, Surname = txtboxSurname.Text, ArtisticName = txtboxArtisticName.Text }; dgvPerformer.DataSource = await _performerService.Get <List <Performer> >(searchObj, "GetPerformers"); }
public List <Performer> Get(PerformerSearchRequest obj) //insertRequest.. same object used for search { var query = _context.Performer.AsQueryable(); if (!string.IsNullOrWhiteSpace(obj.Name)) { query = query.Where(x => x.Name.Contains(obj.Name)); } if (!string.IsNullOrWhiteSpace(obj.Surname)) { query = query.Where(x => x.Surname.Contains(obj.Surname)); } if (!string.IsNullOrWhiteSpace(obj.ArtisticName)) { query = query.Where(x => x.ArtisticName.Contains(obj.ArtisticName)); } return(query.ToList()); }
public ActionResult <List <Performer> > Get([FromQuery] PerformerSearchRequest obj) { return(_service.Get(obj)); }
public PerformerViewModel() { Title = "Performer"; PerformerSearchReq = new PerformerSearchRequest(); }