public async Task <AvailableSeatsSummary> GetCountAsync(IProjectionIdentifier projIdentifier)
        {
            var currProjection = await projectionsRepo.GetProjectionByIdAsync(projIdentifier.ProjectionId);

            var availableSeatsCount = currProjection.AvailableSeatsCount;

            return(new AvailableSeatsSummary(true, availableSeatsCount));
        }
Esempio n. 2
0
        public async Task <AvailableSeatsSummary> GetCountAsync(IProjectionIdentifier projIdentifier)
        {
            var currProjection = await projectionsRepo.GetProjectionByIdAsync(projIdentifier.ProjectionId);

            if (currProjection == null)
            {
                string constraintMessage = $"Projection with Id: {projIdentifier.ProjectionId}, not exist!";

                return(new AvailableSeatsSummary(false, constraintMessage));
            }
            else
            {
                return(await availableSeats.GetCountAsync(projIdentifier));
            }
        }
Esempio n. 3
0
        public async Task <AvailableSeatsSummary> GetCountAsync(IProjectionIdentifier projIdentifier)
        {
            var currProjection = await projectionsRepo.GetProjectionByIdAsync(projIdentifier.ProjectionId);

            if (currProjection.StartDate <= DateTime.Now)
            {
                var constraintMessage = "You are checking for seats too late for this projection! Seats are no longer available.";

                return(new AvailableSeatsSummary(false, constraintMessage));
            }
            else
            {
                return(await availableSeats.GetCountAsync(projIdentifier));
            }
        }