School Commit Init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Lab9.Models;
|
||||
|
||||
namespace Lab9.Context
|
||||
{
|
||||
public class NewsContext : DbContext
|
||||
{
|
||||
public NewsContext(DbContextOptions<NewsContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<News> News { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<News>().ToTable("News");
|
||||
modelBuilder.Entity<User>().ToTable("Users");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user