Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vipwan committed Apr 10, 2024
1 parent e2ae5ea commit 581b06a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
<PackageVersion>1.3.2.2</PackageVersion>
<PackageVersion>1.3.2.3</PackageVersion>
<PackageProjectUrl>https://github.com/vipwan/Biwen.AutoClassGen</PackageProjectUrl>
<Authors>万雅虎</Authors>
<RepositoryUrl>https://github.com/vipwan/Biwen.AutoClassGen</RepositoryUrl>
Expand All @@ -25,9 +25,9 @@
</None>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="Biwen.AutoClassGen" Version="1.3.2.2" PrivateAssets="contentfiles;analyzers" />
</ItemGroup>
<!--<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="Biwen.AutoClassGen" Version="1.3.2.3" PrivateAssets="contentfiles;analyzers" />
</ItemGroup>-->


<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion Biwen.AutoClassGen.Gen/AutoInjectSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ private static List<AutoInjectDefine> GetAnnotatedNodesInject(Compilation compil
foreach (var attr in node.AttributeLists.AsEnumerable())
{
var attrName = attr.Attributes.FirstOrDefault()?.Name.ToString();
attributeSyntax = attr.Attributes.First(x => x.Name.ToString().IndexOf(AttributeValueMetadataNameInject, System.StringComparison.Ordinal) == 0);
attributeSyntax = attr.Attributes.FirstOrDefault(x => x.Name.ToString().IndexOf(AttributeValueMetadataNameInject, System.StringComparison.Ordinal) == 0);

//其他的特性直接跳过
if (attributeSyntax is null) continue;

if (attrName?.IndexOf(AttributeValueMetadataNameInject, System.StringComparison.Ordinal) == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Biwen.AutoClassGen.Gen/Biwen.AutoClassGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<AnalysisLevel>6.0-all</AnalysisLevel>
<Authors>万雅虎</Authors>
<PackageVersion>1.3.2.2</PackageVersion>
<PackageVersion>1.3.2.3</PackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="Biwen.AutoClassGen.Attributes" Version="1.3.2" PrivateAssets="contentfiles;analyzers" />
</ItemGroup>
<!--<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="Biwen.AutoClassGen.Attributes" Version="1.3.2.3" PrivateAssets="contentfiles;analyzers" />
</ItemGroup>-->


<ItemGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
15 changes: 15 additions & 0 deletions Biwen.AutoClassGen.TestConsole/Services/TestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,19 @@ public string Say2(string message)
return message;
}
}




public partial class TestServiceDto
{
}

[AutoInject]
[AutoDto<TestServiceDto>]
public partial class TestService3
{

}

}

0 comments on commit 581b06a

Please sign in to comment.