17 lines
No EOL
485 B
C#
17 lines
No EOL
485 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using SurveyLib.Core.Models;
|
|
|
|
namespace SurveyLib.Infrastructure.EFCore.Data;
|
|
|
|
public class DataContext : DbContext
|
|
{
|
|
public DbSet<Survey> Surveys { get; set; }
|
|
public DbSet<QuestionBase> Questions { get; set; }
|
|
public DbSet<Completion> Completions { get; set; }
|
|
public DbSet<Answer> Answers { get; set; }
|
|
|
|
public DataContext(DbContextOptions<DataContext> options) : base(options)
|
|
{
|
|
Database.EnsureCreated();
|
|
}
|
|
} |