-
Notifications
You must be signed in to change notification settings - Fork 115
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
refactor(Identity): Support custom User Model #192
Conversation
� Conflicts: � Masa.Framework.sln � src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj � src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/_Imports.cs
…to refactor/identity
…to refactor/identity
…to refactor/identity
@@ -33,7 +31,8 @@ internal class DefaultUserContext : UserContext | |||
var modelRelation = ModelRelationCache.GetOrAdd(userType, (type) => | |||
{ | |||
var constructor = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public) | |||
.MinBy(x => x.GetParameters().Length)!; | |||
.FirstOrDefault(c => c.GetParameters().Length == 0) ?? | |||
throw new InvalidOperationException($"【{type.Name}】 has a parameterless constructor"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
【 -> [
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Processed
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Support custom User Model
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: