public IHttpActionResult PutStundasTema(int id, StundasTemaViewModel stundasTemaModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var stundasTema = db.StundasTemas.FirstOrDefault(x => x.Tema_ID == stundasTemaModel.Tema_ID);

            if (id != stundasTema.Tema_ID)
            {
                return(BadRequest());
            }
            stundasTema.Tema            = stundasTemaModel.Tema;
            stundasTema.Piezime         = stundasTemaModel.Piezime;
            db.Entry(stundasTema).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StundasTemaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PostStundasTema(StundasTemaViewModel stundasTemaModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var stundasTema = new StundasTema
            {
                Tema_ID = stundasTemaModel.Tema_ID,
                Tema    = stundasTemaModel.Tema,
                Piezime = stundasTemaModel.Piezime
            };

            db.StundasTemas.Add(stundasTema);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (StundasTemaExists(stundasTema.Tema_ID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("CaptinAmericaApi-StundasTema", new { id = stundasTema.Tema_ID }, new StundasTemaViewModel {
                Tema_ID = stundasTema.Tema_ID,
                Tema = stundasTema.Tema,
                Piezime = stundasTema.Piezime
            }));
        }