Fix MinimalApi to resolve authorization services per-request
- Resolve ICommandAuthorizationService and IQueryAuthorizationService from request-scoped serviceProvider - Allows Scoped authorization services that depend on DbContext - Updated both MinimalApi and DynamicQuery.MinimalApi Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -159,7 +159,10 @@ internal static class ProtoFileTypeMapper
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts C# PascalCase property name to proto snake_case field name
|
||||
/// Converts C# PascalCase property name to proto snake_case field name.
|
||||
/// Uses simple conversion: add underscore before each uppercase letter (except first).
|
||||
/// This matches protobuf's C# codegen expectations for PascalCase conversion.
|
||||
/// Example: TotalADeduire -> total_a_deduire -> TotalADeduire (in generated C#)
|
||||
/// </summary>
|
||||
public static string ToSnakeCase(string pascalCase)
|
||||
{
|
||||
@@ -174,16 +177,8 @@ internal static class ProtoFileTypeMapper
|
||||
var c = pascalCase[i];
|
||||
if (char.IsUpper(c))
|
||||
{
|
||||
// Handle sequences of uppercase letters (e.g., "APIKey" -> "api_key")
|
||||
if (i + 1 < pascalCase.Length && char.IsUpper(pascalCase[i + 1]))
|
||||
{
|
||||
result.Append(char.ToLowerInvariant(c));
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Append('_');
|
||||
result.Append(char.ToLowerInvariant(c));
|
||||
}
|
||||
result.Append('_');
|
||||
result.Append(char.ToLowerInvariant(c));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user