2022-10-19 10:58:08 +00:00
using System ;
using System.Security.Claims ;
2021-10-01 09:09:20 +00:00
using System.Threading.Tasks ;
using Microsoft.AspNet.Identity ;
using Microsoft.AspNet.Identity.EntityFramework ;
namespace Service.MeterProcessState.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
2022-10-19 10:58:08 +00:00
public async Task < ClaimsIdentity > GenerateUserIdentityAsync ( UserManager < ApplicationUser > manager , String authenticationType )
2021-10-01 09:09:20 +00:00
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager . CreateIdentityAsync ( this , authenticationType ) ;
// Add custom user claims here
return userIdentity ;
}
}
public class ApplicationDbContext : IdentityDbContext < ApplicationUser >
{
public ApplicationDbContext ( )
: base ( "DefaultConnection" , throwIfV1Schema : false )
{
}
public static ApplicationDbContext Create ( )
{
return new ApplicationDbContext ( ) ;
}
}
}