CodeLiturgy.Dashboard/BlueWest.Api/StartupExtensions.cs

20 lines
735 B
C#

using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace BlueWest.WebApi;
public static class StartupExtensions
{
public static void GetSqlSettings(this DbContextOptionsBuilder optionsBuilder, IConfiguration configuration)
{
optionsBuilder.UseMySql(configuration.GetConnectionString("LocalMySQL"),
new MySqlServerVersion(new Version(8, 0, 11)))
// The following three options help with debugging, but should
// be changed or removed for production.
.LogTo(Console.WriteLine, LogLevel.Information)
.EnableSensitiveDataLogging()
.EnableDetailedErrors();
}
}