Files
DiunaBI/WebAPI/AppDbContext.cs
2023-02-22 12:12:38 +01:00

32 lines
941 B
C#

using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using WebAPI.Models;
namespace WebAPI
{
public class AppDbContext : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<Layer> Layers { get; set; }
public DbSet<Record> Records { get; set; }
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
public static readonly Microsoft.Extensions.Logging.LoggerFactory _myLoggerFactory =
new LoggerFactory(new[] {
new Microsoft.Extensions.Logging.Debug.DebugLoggerProvider()
});
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseLoggerFactory(_myLoggerFactory);
}
}
}