public async Task <ActionResult> Post(MovieTheaterCreationDto movieCreationDto) { var movieTheater = mapper.Map <MovieTheater>(movieCreationDto); context.Add(movieTheater); await context.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult> Put(int id, MovieTheaterCreationDto movieCreationDto) { var movieTheater = await context.MovieTheaters.FirstOrDefaultAsync(x => x.Id == id); if (movieTheater == null) { return(NotFound()); } mapper.Map(movieCreationDto, movieTheater); await context.SaveChangesAsync(); return(NoContent()); }