public async Task <NewSummary> New(IRoomCreation model) { IRoom room = await this.roomRepo.GetByCinemaAndNumber(model.CinemaId, model.Number); if (room != null) { return(new NewSummary(false, StringConstants.RoomExists)); } return(await newRoom.New(model)); }
public async Task <NewSummary> New(IRoomCreation model) { var cinema = await this.cinemaRepo.GetById(model.CinemaId); if (cinema == null) { return(new NewSummary(false, $"Cinema with id {model.CinemaId} does not exist")); } return(await newRoom.New(model)); }