Use DataSeedHelper

pull/1156/head
Halil ibrahim Kalkan 6 years ago
parent 4660c50ece
commit 88a8988d8d

@ -98,7 +98,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer
"MyProjectName" "MyProjectName"
}; };
/* MyProjectName_Web client is only needed if you created tiered /* MyProjectName_Web client is only needed if you created a tiered
* solution. Otherwise, delete this client. */ * solution. Otherwise, delete this client. */
await CreateClientAsync( await CreateClientAsync(
"MyProjectName_Web", "MyProjectName_Web",

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.Data;
using MyCompanyName.MyProjectName.MultiTenancy; using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AuditLogging; using Volo.Abp.AuditLogging;
@ -49,15 +50,7 @@ namespace MyCompanyName.MyProjectName
/* Seeding in the application startup can be a problem in a clustered environment. /* Seeding in the application startup can be a problem in a clustered environment.
* See https://github.com/abpframework/abp/issues/1123 * See https://github.com/abpframework/abp/issues/1123
*/ */
using (var scope = context.ServiceProvider.CreateScope()) DataSeedHelper.Seed(context);
{
AsyncHelper.RunSync(async () =>
{
await scope.ServiceProvider
.GetRequiredService<IDataSeeder>()
.SeedAsync();
});
}
} }
} }
} }

Loading…
Cancel
Save