Use ASP.NET Identity in a three-tier architecture. How to change CookieAuthenticationProvider?

Use a three-tier architecture and ASP.NET Identity. Used the guide with metanit: metanit.com/sharp/mvc5/23.10.php
The problem is that I would like in mvc project Startup to register in your UseCookieAuthentication CookieAuthenticationProvider.
Provider = new CookieAuthenticationProvider
{
 OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<applicationusermanager, applicationuser, int>
 (TimeSpan.FromMinutes(30), async (manager, user) =>
{
 var userIdentity = await manager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
 //userIdentity.AddClaim(new Claim("FriendlyName", friendlyName));
 //userIdentity.AddClaim(new Claim("balance", balance.ToString(CultureInfo.CurrentCulture)));
 //userIdentity.AddClaim(new Claim("sms", sms.ToString()));
 //userIdentity.AddClaim(new Claim("minutes", minutes.ToString()));
 return userIdentity;
 }, id => id.GetUserId<int>())
 }</int></applicationusermanager,>

The problem is that error CS0012 C# The type is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNet.Identity.EntityFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Which can be solved by importing the desired Libu but she'll potamic and EF. And as I understand EF does not Golino to be in the PL. How to solve it differently this task?
July 2nd 19 at 18:00
1 answer
July 2nd 19 at 18:02
Solution
Yet decided the question differently.
1) Moved ApplicationRoleManager, ApplicationSignInManager, ApplicationUserManager of DAL in BLL where they essentially had to be as I understand it, it left the UserStore and RoleStore in DAl in UnitOfWork.
2) Create 2 static methods in ApplicationSignInManager
public static Func<cookievalidateidentitycontext, task> OnValidateIdentity()
{
 return SecurityStampValidator.OnValidateIdentity<applicationusermanager, applicationuser, int>(TimeSpan.FromMinutes(30), GetIdentityAsync, id => id.GetUserId<int>());
}

 public static async Task<claimsidentity> GetIdentityAsync(ApplicationUserManager manager, ApplicationUser user)
{
 var userIdentity = await manager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);
 //userIdentity.AddClaim(new Claim("FriendlyName", friendlyName));
 //userIdentity.AddClaim(new Claim("balance", balance.ToString(CultureInfo.CurrentCulture)));
 //userIdentity.AddClaim(new Claim("sms", sms.ToString()));
 //userIdentity.AddClaim(new Claim("minutes", minutes.ToString()));
 return userIdentity;
 }</claimsidentity></int></applicationusermanager,></cookievalidateidentitycontext,>

and connected Owin library to BLL
3) Startup the MVC used in the generated method
Provider = new CookieAuthenticationProvider
{
 OnValidateIdentity = ApplicationSignInManager.OnValidateIdentity()
 }


Thus, in the BLL appeared libs for working with OWIN and PL did not appear EF

Find more questions by tags ASP.NETC#