public async Task <ActionResult <CastModel> > PostCast([FromBody] CastModel Cast) { //CastModel Cast = new CastModel { label = "NewCast", filename = "New Cast" }; doruContext.CastSet.Add(Cast); await doruContext.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCast), new { id = Cast.Id }, Cast)); }
public async Task <ActionResult <CoverModel> > PostCover([FromBody] CoverModel cover) { //CoverModel cover = new CoverModel { label = "NewCover", filename = "New Cover" }; doruContext.CoverSet.Add(cover); await doruContext.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCover), new { id = cover.Id }, cover)); }
public async Task <ActionResult <CoverModel> > PostCover([FromBody] CoverModel cover) { //return coverRepo.AddCover(cover); try { doruDB.Cover.Add(cover); await doruDB.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCover), new { id = cover.Id }, cover)); } catch { throw; } }