Can't get UserManager from OwinContext in apicontroller

后端 未结 3 1701
暗喜
暗喜 2020-12-07 20:15

I\'m following a Microsoft sample to implement email validation with Identity 2.0.0

I\'m stuck at this part

public ApplicationUserManager UserManager         


        
3条回答
  •  心在旅途
    2020-12-07 20:25

    This single line of code saved my day...

           var manager = 
           new ApplicationUserManager(new UserStore(new ApplicationDbContext()));
    

    You can use it within a controller action to get an instance of UserManager.

提交回复
热议问题