Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public List <Model.Lijek> Get([FromQuery] LijekSearchRequest request)
 {
     return(_service.Get(request));
 }