2020-12-02 23:05:06 +01:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using SessionCompanion.Database.Tables;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace SessionCompanion.Database
|
|
|
|
|
{
|
|
|
|
|
public class ApplicationDbContext : DbContext
|
|
|
|
|
{
|
|
|
|
|
public virtual DbSet<Alignment> Alignments { get; set; }
|
|
|
|
|
public virtual DbSet<Background> Backgrounds { get; set; }
|
|
|
|
|
public virtual DbSet<Biography> Biographies { get; set; }
|
|
|
|
|
public virtual DbSet<Character> Characters { get; set; }
|
|
|
|
|
public virtual DbSet<Class> Classes { get; set; }
|
|
|
|
|
public virtual DbSet<Race> Races { get; set; }
|
|
|
|
|
public virtual DbSet<Statistics> Statistics { get; set; }
|
|
|
|
|
public virtual DbSet<User> Users { get; set; }
|
|
|
|
|
|
|
|
|
|
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { }
|
|
|
|
|
|
2020-12-03 17:00:04 +01:00
|
|
|
|
protected override void OnModelCreating(ModelBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(builder);
|
|
|
|
|
builder.Entity<User>().HasData(
|
2020-12-02 23:05:06 +01:00
|
|
|
|
new
|
|
|
|
|
{
|
2020-12-03 17:00:04 +01:00
|
|
|
|
Id = 1,
|
|
|
|
|
Nickname = "Morwiec",
|
2020-12-02 23:05:06 +01:00
|
|
|
|
Password = "123"
|
|
|
|
|
},
|
2020-12-03 17:00:04 +01:00
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
Id = 2,
|
|
|
|
|
Nickname = "Cichoklepiec",
|
|
|
|
|
Password = "123"
|
|
|
|
|
},
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
Id = 3,
|
|
|
|
|
Nickname = "Ruletka",
|
|
|
|
|
Password = "123"
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
2020-12-02 23:05:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|