-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Use AssemblyQualifiedName to distinguish db functions. Fix issue #18425 #18612
Use AssemblyQualifiedName to distinguish db functions. Fix issue #18425 #18612
Conversation
338520e
to
6ef7c9d
Compare
@@ -121,7 +121,8 @@ public static IEnumerable<DbFunction> GetDbFunctions([NotNull] Model model) | |||
private static string BuildAnnotationName(MethodBase methodBase) | |||
=> | |||
// ReSharper disable once AssignNullToNotNullAttribute | |||
$"{RelationalAnnotationNames.DbFunction}{methodBase.DeclaringType.ShortDisplayName()}{methodBase.Name}({string.Join(",", methodBase.GetParameters().Select(p => p.ParameterType.Name))})"; | |||
// ReSharper disable once PossibleNullReferenceException | |||
$"{RelationalAnnotationNames.DbFunction}{methodBase.DeclaringType.AssemblyQualifiedName}{methodBase.Name}({string.Join(",", methodBase.GetParameters().Select(p => p.ParameterType.Name))})"; |
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.
Use namespace qualified name.
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.
ParameterType.Name will only return Nullable`1 without the generic parameter for nullable fields so I switched to Fullname to prevent collisions there as well.
6ef7c9d
to
82becd4
Compare
82becd4
to
924c618
Compare
924c618
to
5347ffe
Compare
Can we also update the commit message. |
cc: @Pilchie |
5347ffe
to
fe0d550
Compare
@pmiddleton - Thanks 😄 |
Update dbfunctions to use the AssemblyQualifiedName in their annotation name. This will prevent nested, and cross assembly, class functions from having name collisions.
Fixes #18425