public async Task <HttpResponseMessage> GetKorisnikAsync(Guid id)
        {
            try
            {
                var response = Mapper.Map <KorisnikViewModel>(await korisnikService.Get(id));

                if (response == null)
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Traženi element nije pronađen u bazi podataka"));
                }


                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, e));
            }
        }
Exemplo n.º 2
0
 public List <Korisnici> Get([FromQuery] KorisniciSearchRequest request)
 {
     return(_service.Get(request));
 }
 public ActionResult <List <Model.Korisnik> > Get([FromQuery] KorisniciSearchRequest request)
 {
     return(_korisnikService.Get(request));
 }
 public List <Model.Korisnik> Get([FromQuery] KorisnikSearchRequest request)
 {
     return(_service.Get(request));
 }
Exemplo n.º 5
0
 public List <KorisnikModel> Get([FromQuery] KorisnikSearchRequest search)
 {
     return(_korisnikService.Get(search));
 }