using System.Collections.Generic; using Forum.DataAccessLayer.Models; namespace Forum.DataAccessLayer.Migrations { using System; using System.Linq; internal sealed class Configuration : DbMigrationsConfiguration { public Configuration() { AutomaticMigrationsEnabled = false; } protected override void Seed(Forum.DataAccessLayer.ApplicationDbContext context) { if (!context.Categories.Any(c=>c.CategoryName=="Zwroty")) { var zwroty = new Category() { CategoryName = "Zwroty", Questions = new List() { new Question() { Title = "Jak dokonać zwrotu", Content = "Chce dostać zwrot nwm co robic pls admian halp!11", IsClosed = false, PostDate = DateTime.Now, Nick = "Potrzebujący" } } }; context.Categories.Add(zwroty); context.SaveChanges(); } } } }