26 lines
964 B
C#
26 lines
964 B
C#
using GreadyPoang.EntityLayer;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace GreadyPoang.DataLayer.Database
|
|
{
|
|
public class DataContext : DbContext
|
|
{
|
|
public DataContext(DbContextOptions<DataContext> options) : base(options)
|
|
{
|
|
|
|
}
|
|
//public DbSet<User> Users => Set<User>();
|
|
public DbSet<Participant> Participants { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
modelBuilder.Entity<Participant>().HasData(
|
|
new Participant { ParticipantId = 1, FirstName = "John", LastName = "Doe", Email = "John.Doe@gmail.com" },
|
|
new Participant { ParticipantId = 2, FirstName = "Jane", LastName = "Black", Email = "jb@gmail.com" },
|
|
new Participant { ParticipantId = 3, FirstName = "Mary", LastName = "White", Email = "mw@gmail.com" }
|
|
);
|
|
}
|
|
}
|
|
}
|