surveylib/SurveyLib.Infrastructure.EFCore/Data/DataContext.cs
2025-03-14 22:47:19 +05:00

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();
}
}