Closed HaoK closed 5 years ago
Per triage we will revisit this in for 3.0
I’ll look forward to it. At the moment our TUser is really a “user accessor” which has to be contextualised to retrieve the real orm object, which is fine in IUserStore but kind of a pain for app code to do.
This repo is being archived. If this is still something you want to get merged, open a new PR against https://github.com/aspnet/AspNetCore
Exploring fixes for https://github.com/aspnet/Identity/issues/1722
Not sure if this might be more appropriate for 3.0 as its will be hard to do this in a non breaking change way in 2.2, basically moves away from Activator.CreateInstance infavor of a dedicated DefaultUIUserFactory which will be used to create new user instances.
We provide a default one that works for identity user based classes that have a default constructor, custom users can add their own factory implementation that implements:
TUser Create(string userName, string email)
or they can just register it inline like so with a sugar method:
Thoughts @ajcvickers @javiercn @blowdart