public async Task <ActionResult> Post([FromBody] TheaterAddDTO theaterAddDTO) { var theather = mapper.Map <Theaters>(theaterAddDTO); context.Add(theather); await context.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult> Put(int Id, [FromBody] TheaterAddDTO theaterAdd) { var theater = await context.Theaters.FirstOrDefaultAsync(x => x.id == Id); if (theater == null) { return(NotFound()); } theater = mapper.Map(theaterAdd, theater); await context.SaveChangesAsync(); return(NoContent()); }