Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (var scope = ServiceProvider.CreateScope())
- {
- var dbContextLocal =
- scope.ServiceProvider.GetRequiredService<C4S_DataContext>();
- dbContextLocal.Database.EnsureCreated(); //Exception occurs here
- if (!dbContextLocal.Kontakte.Any())
- {
- var settingsViewModel = new SettingsViewModel(dbContextLocal);
- settingsViewModel.SyncDatabasesCommand.Execute(null);
- }
- }
Add Comment
Please, Sign In to add comment