Example #1
0
        public async Task <ExecutionResult> Execute(ExecuteContext <IAddCustomerDomainToDatabaseArguments> context)
        {
            var arguments = context.Arguments;

            await _office365DbDomainService.CreateDatabaseCustomerDomainAsync(new Office365CustomerDomainModel
            {
                Office365CustomerId = arguments.Office365CustomerId,
                Domain = arguments.Domain,
                Office365DomainStaus = Office365DomainStatus.NotValidated
            });

            return(context.Completed());
        }
Example #2
0
        public async Task <ExecutionResult> Execute(ExecuteContext <IAddMultiDomainToDatabaseArguments> context)
        {
            var arguments = context.Arguments;

            foreach (var domain in arguments.Domains)
            {
                await _office365DbDomainService.CreateDatabaseCustomerDomainAsync(new Office365CustomerDomainModel
                {
                    Office365CustomerId = arguments.Office365CustomerId,
                    Domain = domain,
                    Office365DomainStaus = Office365DomainStatus.Validated
                });
            }

            return(context.Completed(new AddMultiDomainToDatabaseLog
            {
                Office365CustomerId = arguments.Office365CustomerId,
                Domains = arguments.Domains
            }));
        }