Files
School/Anul 2/Semestrul 2/Web/Lab 9/Lab9/Context/NewsContext.cs
T
2024-08-31 12:07:21 +03:00

24 lines
549 B
C#

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