Guest User

Untitled

a guest
Jan 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. using (var scope = ServiceProvider.CreateScope())
  2. {
  3. var dbContextLocal =
  4. scope.ServiceProvider.GetRequiredService<C4S_DataContext>();
  5. dbContextLocal.Database.EnsureCreated(); //Exception occurs here
  6.  
  7. if (!dbContextLocal.Kontakte.Any())
  8. {
  9. var settingsViewModel = new SettingsViewModel(dbContextLocal);
  10. settingsViewModel.SyncDatabasesCommand.Execute(null);
  11. }
  12. }
Add Comment
Please, Sign In to add comment