idk something about efcore
This commit is contained in:
parent
751b08e805
commit
6732613466
8 changed files with 103 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using SurveyBackend.Core.Models;
|
||||
|
||||
namespace SurveyBackend.Infrastructure.Data;
|
||||
|
||||
public class DataContext : DbContext
|
||||
{
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<Group> Groups { get; set; }
|
||||
|
||||
public DataContext(DbContextOptions<DataContext> options) : base(options)
|
||||
{
|
||||
Database.EnsureCreated();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue