Beispiel #1
0
        private async void btnPrikazi_Click(object sender, EventArgs e)
        {
            var search = new LijekSearchRequest()
            {
                Naziv = txtPretraga.Text
            };
            var result = await _apiService.Get <List <Model.Lijek> >(search);

            dgvLijekovi.DataSource = result;
        }
Beispiel #2
0
        private async void btnPrikazi_Click(object sender, EventArgs e)
        {
            var search = new LijekSearchRequest()
            {
                Naziv = txtNaziv.Text
            };

            var list = await _apiService.Get <List <Model.Lijek> >(search);

            dgvLijekovi.AutoGenerateColumns = false;

            dgvLijekovi.DataSource = list;
        }
        public List <Model.Lijek> Get(LijekSearchRequest request)
        {
            var query = _context.Lijek.AsQueryable();

            if (!string.IsNullOrWhiteSpace(request?.Naziv))
            {
                query = query.Where(x => x.Naziv.StartsWith(request.Naziv));
            }

            query = query.Include(x => x.Proizvodjac);

            var list = query.ToList();

            return(_mapper.Map <List <Model.Lijek> >(list));
        }
Beispiel #4
0
 public List <Model.Lijek> Get([FromQuery] LijekSearchRequest request)
 {
     return(_service.Get(request));
 }