How do I expose `UserManager` to my business layer while hiding `IdentityUser`?

前端 未结 1 1239
终归单人心
终归单人心 2021-01-24 06:51

I don\'t want to reference EntityFramework and hence Identity.EntityFramework with its IdentityUser in my domain. But I\'d like to use UserManage

相关标签:
1条回答
  • 2021-01-24 07:30

    It required me to write an adapter to Microsoft.AspNet.Identity.Framework.UserStore that inherits from IUserStore and thus can be used with UserManager. It maps my custom user object to IdentityUser. The gist for it can be found at https://gist.github.com/w1ld/b9228f5a27c54b061f90#file-userstoreadapter-cs Hope it helps someone!

    0 讨论(0)
提交回复
热议问题