//[Authorize(Roles = "admin")]
        public async Task <ActionResult <ProjectionDomainModel> > PostAsync(CreateProjectionModel projectionModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (projectionModel.ProjectionTime < DateTime.Now)
            {
                ModelState.AddModelError(nameof(projectionModel.ProjectionTime), Messages.PROJECTION_IN_PAST);
                return(BadRequest(ModelState));
            }

            ProjectionDomainModel domainModel = new ProjectionDomainModel
            {
                AuditoriumId   = projectionModel.AuditoriumId,
                MovieId        = projectionModel.MovieId,
                ProjectionTime = projectionModel.ProjectionTime
            };

            CreateProjectionResultModel createProjectionResultModel;

            try
            {
                createProjectionResultModel = await _projectionService.CreateProjection(domainModel);
            }
            catch (DbUpdateException e)
            {
                ErrorResponseModel errorResponse = new ErrorResponseModel
                {
                    ErrorMessage = e.InnerException.Message ?? e.Message,
                    StatusCode   = System.Net.HttpStatusCode.BadRequest
                };

                return(BadRequest(errorResponse));
            }

            if (!createProjectionResultModel.IsSuccessful)
            {
                ErrorResponseModel errorResponse = new ErrorResponseModel
                {
                    ErrorMessage = createProjectionResultModel.ErrorMessage,
                    StatusCode   = System.Net.HttpStatusCode.BadRequest
                };

                return(BadRequest(errorResponse));
            }

            return(Created("projections//" + createProjectionResultModel.Projection.Id, createProjectionResultModel.Projection));
        }
 public ProjectionModel CreateProjection(ProjectionModel projectionModel)
 {
     return(_projectionService.CreateProjection(projectionModel));
 }