简体   繁体   中英

Can asp.net identity 2.0 run in it's own project?

I have just created a new asp.net mvc 5 project, but would like to abstract all of the identity logic into it's own project. I did something like this with asp.net identity 1.0, but through lack of understanding or otherwise, found it less than ideal as it appeared that I needed to duplicate several references for each project as well as the entity framework connection string to get it to work. I tried this same tactic with the latest version of identity 2.0 with no success. So is there a suggested way to do this, or is it better to just keep all the identity logic in the main mvc startup project?

There should be nothing preventing you from writing a shared class library that abstracts identity apis for you. Your MVC app would depend on the shared class library and use any apis exposed there, while your class library can reference identity (or whatever else you want) to implement its functionality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM