Added some EFCore stuff to webapi
This commit is contained in:
21
WebAPI/Data/AppDbContext.cs
Normal file
21
WebAPI/Data/AppDbContext.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using WebAPI.Data.Models;
|
||||
|
||||
namespace WebAPI.Data
|
||||
{
|
||||
public class AppDbContext : DbContext
|
||||
{
|
||||
public DbSet<User> Users { get; set; }
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
// Place any config overrides here
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user