2018-12-02 00:19:58 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Forum.DataAccessLayer.Models;
|
|
|
|
|
|
2018-12-01 22:12:59 +01:00
|
|
|
|
namespace Forum.DataAccessLayer.Migrations
|
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
internal sealed class Configuration : DbMigrationsConfiguration<Forum.DataAccessLayer.ApplicationDbContext>
|
|
|
|
|
{
|
|
|
|
|
public Configuration()
|
|
|
|
|
{
|
|
|
|
|
AutomaticMigrationsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Seed(Forum.DataAccessLayer.ApplicationDbContext context)
|
|
|
|
|
{
|
2018-12-02 00:19:58 +01:00
|
|
|
|
if (!context.Categories.Any(c=>c.CategoryName=="Zwroty"))
|
|
|
|
|
{
|
|
|
|
|
var zwroty = new Category()
|
|
|
|
|
{
|
|
|
|
|
CategoryName = "Zwroty",
|
|
|
|
|
Questions = new List<Question>()
|
|
|
|
|
{
|
|
|
|
|
new Question()
|
|
|
|
|
{
|
|
|
|
|
Title = "Jak dokona<6E> zwrotu",
|
|
|
|
|
Content = "Chce dosta<74> zwrot nwm co robic pls admian halp!11",
|
|
|
|
|
IsClosed = false,
|
|
|
|
|
PostDate = DateTime.Now,
|
|
|
|
|
Nick = "Potrzebuj<75>cy"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
context.Categories.Add(zwroty);
|
2018-12-01 22:12:59 +01:00
|
|
|
|
|
2018-12-02 00:19:58 +01:00
|
|
|
|
context.SaveChanges();
|
|
|
|
|
}
|
2018-12-01 22:12:59 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|