Esempio n. 1
0
        public static IAccount CreateAccount(IInternalSyncDataStore dataStoreSync, string accountsHref, IAccount account, Action <AccountCreationOptionsBuilder> creationOptionsAction)
        {
            var builder = new AccountCreationOptionsBuilder();

            creationOptionsAction(builder);
            var options = builder.Build();

            return(dataStoreSync.Create(accountsHref, account, options));
        }
Esempio n. 2
0
        public static Task <IAccount> CreateAccountAsync(IInternalAsyncDataStore dataStore, string accountsHref, IAccount account, Action <AccountCreationOptionsBuilder> creationOptionsAction, CancellationToken cancellationToken)
        {
            var builder = new AccountCreationOptionsBuilder();

            creationOptionsAction(builder);
            var options = builder.Build();

            return(dataStore.CreateAsync(accountsHref, account, options, cancellationToken));
        }
            public async Task Create_with_response_options()
            {
                var optionsBuilder = new AccountCreationOptionsBuilder();

                optionsBuilder.ResponseOptions.Expand(x => x.GetCustomData());
                var options = optionsBuilder.Build();

                await this.VerifyThat(options, resultsInQueryString : "?expand=customData");
            }
            public async Task Create_with_all_options()
            {
                var optionsBuilder = new AccountCreationOptionsBuilder();

                optionsBuilder.RegistrationWorkflowEnabled = true;
                optionsBuilder.ResponseOptions.Expand(x => x.GetGroups(0, 10));
                var options = optionsBuilder.Build();

                await this.VerifyThat(options, resultsInQueryString : "?expand=groups(offset:0,limit:10)&registrationWorkflowEnabled=true");
            }