Exemplo n.º 1
0
        public Drzava Add([FromBody] DrzavaAddVM x)
        {
            var newEmployee = new Drzava
            {
                naziv = x.opis,
            };

            _dbContext.Add(newEmployee);
            _dbContext.SaveChanges();
            return(newEmployee);
        }
        public ActionResult <Drzava> Add([FromBody] DrzavaAddVM x)
        {
            if (!HttpContext.GetLoginInfo().isPermisijaStudentskaSluzba)
            {
                return(BadRequest("nije logiran"));
            }

            var newEmployee = new Drzava
            {
                naziv = x.opis,
            };

            _dbContext.Add(newEmployee);
            _dbContext.SaveChanges();
            return(newEmployee);
        }