예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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;
            }
        }