Пример #1
0
        public IActionResult PostRoom([FromBody] TheaterRoomDTO theaterRoom)
        {
            TheaterRoomRepository repo = new TheaterRoomRepository();

            repo.AddTheaterRoom(theaterRoom);
            return(Ok());
        }
 public async void AddTheaterRoom(TheaterRoomDTO theaterRoom)
 {
     using (var db = new TheaterDbContext())
     {
         db.TheaterRooms.Add(new TheaterRoomFactory().FromDto(theaterRoom));
         await db.SaveChangesAsync();
     }
 }