コード例 #1
0
        public async Task <bool> CreateCinema(CreateCinemaBindingModel model)
        {
            Cinema newCinema = new Cinema(model.Name, model.Address);

            this.DbContext.Cinemas.Add(newCinema);

            var rowsAffected = await this.DbContext.SaveChangesAsync();

            return(rowsAffected == 1);
        }
コード例 #2
0
        public async Task <IHttpActionResult> CreateCinema(CreateCinemaBindingModel model)
        {
            var isCreated = await this.service.CreateCinema(model);

            if (isCreated)
            {
                return(Ok());
            }

            return(NotFound());
        }