33 lines
No EOL
1.3 KiB
C#
33 lines
No EOL
1.3 KiB
C#
using System.Data.Entity;
|
|
using System.Security.Claims;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNet.Identity;
|
|
using Microsoft.AspNet.Identity.EntityFramework;
|
|
|
|
namespace AYA.SlnSinort.Mantenimientos.Models
|
|
{
|
|
// Puede agregar datos del perfil del usuario agregando más propiedades a la clase ApplicationUser. Para más información, visite http://go.microsoft.com/fwlink/?LinkID=317594.
|
|
public class ApplicationUser : IdentityUser
|
|
{
|
|
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
|
|
{
|
|
// Tenga en cuenta que el valor de authenticationType debe coincidir con el definido en CookieAuthenticationOptions.AuthenticationType
|
|
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
|
|
// Agregar aquí notificaciones personalizadas de usuario
|
|
return userIdentity;
|
|
}
|
|
}
|
|
|
|
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
|
{
|
|
public ApplicationDbContext()
|
|
: base("DefaultConnection", throwIfV1Schema: false)
|
|
{
|
|
}
|
|
|
|
public static ApplicationDbContext Create()
|
|
{
|
|
return new ApplicationDbContext();
|
|
}
|
|
}
|
|
} |