-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLoggingDbContextBase.cs
More file actions
34 lines (26 loc) · 1.15 KB
/
LoggingDbContextBase.cs
File metadata and controls
34 lines (26 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Source Tree Solutions, LLC. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Author: Joe Audette
// Created: 2015-12-10
// Last Modified: 2016-11-09
//
using cloudscribe.Logging.Models;
using Microsoft.EntityFrameworkCore;
namespace cloudscribe.Logging.EFCore
{
public class LoggingDbContextBase : DbContext
{
public LoggingDbContextBase(DbContextOptions options) : base(options)
{
}
public DbSet<LogItem> LogItems { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
// Suppress pending model changes warning in .NET 10
// EF Core 10 detects minor model differences that don't require actual schema changes
optionsBuilder.ConfigureWarnings(warnings =>
warnings.Ignore(Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning));
base.OnConfiguring(optionsBuilder);
}
}
}