コード例 #1
0
        private async Task CreateOrUpdateDefaultSellerUser(EnvironmentSeed seed, string token)
        {
            // the middleware api client will use this user as the default context user
            var middlewareIntegrationsUser = SeedConstants.MiddlewareIntegrationsUser();

            await _oc.AdminUsers.SaveAsync(middlewareIntegrationsUser.ID, middlewareIntegrationsUser, token);

            // used to log in immediately after seeding the organization
            var initialAdminUser = new User
            {
                ID        = "InitialAdminUser",
                Username  = seed.InitialAdminUsername,
                Password  = seed.InitialAdminPassword,
                Email     = "*****@*****.**",
                Active    = true,
                FirstName = "Initial",
                LastName  = "User"
            };
            await _oc.AdminUsers.SaveAsync(initialAdminUser.ID, initialAdminUser, token);
        }