private Settings CreateAndSaveDefaultSettings(ApplicationDbContext dbContext) { var settings = new Settings() { TwitterApiKey = "twitterkey", FacebookApiKey = "facebookkey", GoogleAnalyticsKey = "googlekey" }; dbContext.Settings.Add(settings); dbContext.SaveChanges(); return settings; }
private void LoadData(Settings settings) { Data[nameof(settings.TwitterApiKey)] = settings.TwitterApiKey; Data[nameof(settings.FacebookApiKey)] = settings.FacebookApiKey; Data[nameof(settings.GoogleAnalyticsKey)] = settings.GoogleAnalyticsKey; }