34 lines
926 B
C#
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
|
|
}
|
|
} |