protected async override Task <Either <CommandResult, Error> > ExecuteCommand(SubscriptionDeleteCommand command)
        {
            if (!(await spaceService.DoesSpaceExist(command.Space)))
            {
                return(new NotFoundError());
            }

            await subService.DeleteSubscription(command.Space, command.User);

            return(Success());
        }
Пример #2
0
        protected async override Task <Either <CommandResult, Error> > ExecuteCommand(SubscriptionCreateCommand command)
        {
            if (!(await spaceService.DoesSpaceExist(command.Data.Space)))
            {
                return(new NotFoundError());
            }

            Subscription s = await subService.CreateSubscription(command.Data, command.User);

            return(Insert(s.Id));
        }
        protected async override Task <Either <CommandResult, Error> > ExecuteCommand(SpaceUpdateCommand command)
        {
            if (!(await service.DoesSpaceExist(command.Space)))
            {
                return(new NotFoundError());
            }

            await service.Update(command.Space, command.Update, command.User);

            return(Success());
        }
Пример #4
0
        protected async override Task <Either <CommandResult, Error> > ExecuteCommand(SpaceCreateCommand command)
        {
            if (!(await service.DoesSpaceExist(command.Data.Name)))
            {
                return(new NotFoundError(""));
            }

            Space s = await service.Create(command.Data, command.User);

            return(Insert(s.Id));
        }