Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Identity Model Customization #31

Closed
Mattnificent opened this issue Aug 5, 2021 · 2 comments
Closed

Support for Identity Model Customization #31

Mattnificent opened this issue Aug 5, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists enhancement-XXL New feature request. Tshirt size: XXL

Comments

@Mattnificent
Copy link

As described here:

https://docs.microsoft.com/en-us/aspnet/core/security/authentication/customize-identity-model

Not sure if this is possible - I tried this a few weeks ago, and just reverted everything back because I got caught in a snag.

I was able to add the attributes to my custom IdentityUser class, and context (fully qualified class names, since I don't see a way to add "using" statements to the generated context/model files)

The snag I ran into was that I couldn't specify the Primary Key for my inherited IdentityUser class in the EFDesign surface. Maybe there's a way to monkeywrench this thing to work in the Fluent API of the custom context partial class?

Would be super cool!

@msawczyn
Copy link
Owner

Duplicates #38

It's not trivial, unfortunately. The approach I think is best (and I've worked off and on for quite some time now) is to start with a customized designer that pre-creates the necessary classes. There are a ton of things that, because of how the model integrates into Identity, have to be immutable when they would normally be editable -- but only for those classes. The complexity snowballs pretty quickly.

I haven't given up on getting this in, though. It would be a very popular addition. The overriding principles of code safety, simplicity of use and creating a pit of success drive the design, though.

@msawczyn msawczyn added duplicate This issue or pull request already exists enhancement-XXL New feature request. Tshirt size: XXL labels Aug 24, 2021
@msawczyn msawczyn transferred this issue from msawczyn/EFDesigner Aug 14, 2022
@msawczyn
Copy link
Owner

Closing as duplicate of #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement-XXL New feature request. Tshirt size: XXL
Projects
None yet
Development

No branches or pull requests

2 participants