Files
gwms/GWMS.Data/UserIdentityDbContext.cs
T
2021-06-24 16:13:45 +02:00

34 lines
926 B
C#

using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
namespace GWMS.Data
{
public class UserIdentityDbContext : IdentityDbContext
{
#region Public Constructors
public UserIdentityDbContext(DbContextOptions<UserIdentityDbContext> options)
: base(options)
{
}
#endregion Public Constructors
#region Protected Methods
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
string connString = DbConfig.CONNECTION_STRING;
if (!optionsBuilder.IsConfigured)
{
var serverVersion = ServerVersion.AutoDetect(connString);
optionsBuilder.UseMySql(connString, serverVersion);
}
}
#endregion Protected Methods
}
}