public async Task <IHttpActionResult> PutPlayListMaster(int id, PlayListMaster playListMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != playListMaster.PlayListID) { return(BadRequest()); } playListMaster.UpdateDate = DateTime.Now; db.Entry(playListMaster).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayListMasterExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetPlayListMaster(int id) { PlayListMaster playListMaster = await db.PlayListMaster.FindAsync(id); if (playListMaster == null) { return(NotFound()); } return(Ok(playListMaster)); }
public async Task <IHttpActionResult> DeletePlayListMaster(int id) { PlayListMaster playListMaster = await db.PlayListMaster.FindAsync(id); if (playListMaster == null) { return(NotFound()); } db.PlayListMaster.Remove(playListMaster); await db.SaveChangesAsync(); return(Ok(playListMaster)); }
public async Task <IHttpActionResult> PostPlayListMaster(PlayListMaster playListMaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } playListMaster.UpdateDate = DateTime.Now; playListMaster.InsertDate = DateTime.Now; playListMaster.UseFlag = true; db.PlayListMaster.Add(playListMaster); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = playListMaster.PlayListID }, playListMaster)); }