Skip to content

Commit c9309d3

Browse files
committed
Update RemoteConfigSourceGenerator.cs
1 parent c88c141 commit c9309d3

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

SourceGenerator/RemoteConfigSourceGenerator.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,18 @@ private string GetPrefsPrefix(INamedTypeSymbol classSymbol)
563563

564564
private object GetAttributePropertyValue(AttributeData attribute, string propertyName)
565565
{
566-
var namedArg = attribute.NamedArguments.FirstOrDefault(na => na.Key == propertyName);
567-
if (namedArg.Key != null)
568-
return namedArg.Value.Value;
566+
// Check named arguments (e.g., Key = "value")
567+
foreach (var namedArg in attribute.NamedArguments)
568+
{
569+
if (namedArg.Key == propertyName)
570+
return namedArg.Value.Value;
571+
}
572+
573+
// Check constructor arguments for "Key" property specifically
574+
if (propertyName == "Key" && attribute.ConstructorArguments.Length > 0)
575+
{
576+
return attribute.ConstructorArguments[0].Value;
577+
}
569578

570579
return null;
571580
}

0 commit comments

Comments
 (0)