public async Task <IHttpActionResult> Postvw_shoot(vw_shoot vw_shoot) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.vw_shoot.Add(vw_shoot); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (vw_shootExists(vw_shoot.ShooterId)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = vw_shoot.ShooterId }, vw_shoot)); }
public async Task <IHttpActionResult> Putvw_shoot(int id, vw_shoot vw_shoot) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != vw_shoot.ShooterId) { return(BadRequest()); } db.Entry(vw_shoot).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!vw_shootExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Getvw_shoot(int id) { vw_shoot vw_shoot = await db.vw_shoot.FindAsync(id); if (vw_shoot == null) { return(NotFound()); } return(Ok(vw_shoot)); }
public async Task <IHttpActionResult> Deletevw_shoot(int id) { vw_shoot vw_shoot = await db.vw_shoot.FindAsync(id); if (vw_shoot == null) { return(NotFound()); } db.vw_shoot.Remove(vw_shoot); await db.SaveChangesAsync(); return(Ok(vw_shoot)); }