public IHttpActionResult PutTablicaHitova(int Id, TablicaHitova TablicaHitova) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (Id != TablicaHitova.Id) { return(BadRequest()); } db.Entry(TablicaHitova).State = System.Data.Entity.EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TablicaHitovaExists(Id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetTablicaHitovas(int Id) { TablicaHitova TablicaHitova = db.TablicaHitovas.Find(Id); if (TablicaHitova == null) { return(NotFound()); } return(Ok(TablicaHitova)); }
public IHttpActionResult PostTablicaHitova(TablicaHitova TablicaHitova) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TablicaHitovas.Add(TablicaHitova); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = TablicaHitova.Id }, TablicaHitova)); }
public IHttpActionResult DeleteTablicaHitova(int Id) { TablicaHitova TablicaHitova = db.TablicaHitovas.Find(Id); if (TablicaHitova == null) { return(NotFound()); } db.TablicaHitovas.Remove(TablicaHitova); db.SaveChanges(); return(Ok(TablicaHitova)); }