Skip to content

Commit 0da27cf

Browse files
committed
Fixed NRE if no dbsets were found in the project
1 parent 0b4ba31 commit 0da27cf

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

AutoDbSet/AutoDbSet.csproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<PackageId>Atulin.AutoDbSet</PackageId>
99
<Title>AutoDbSet</Title>
10-
<Version>1.2.1</Version>
10+
<Version>1.2.2</Version>
1111
<Authors>Atulin</Authors>
1212
<PackageReadmeFile>README.md</PackageReadmeFile>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -22,6 +22,13 @@
2222
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2323
</PropertyGroup>
2424

25+
<PropertyGroup>
26+
<MeziantouPolyfill_IncludedPolyfills>
27+
T:System.Runtime.CompilerServices.CompilerRequiredAttribute;
28+
T:System.Runtime.CompilerServices.IsExternalInit;
29+
</MeziantouPolyfill_IncludedPolyfills>
30+
</PropertyGroup>
31+
2532
<ItemGroup>
2633
<None Include="../README.md" Pack="true" PackagePath="\"/>
2734
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
@@ -32,6 +39,10 @@
3239
<PrivateAssets>all</PrivateAssets>
3340
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3441
</PackageReference>
42+
<PackageReference Include="Meziantou.Polyfill" Version="1.0.157">
43+
<PrivateAssets>all</PrivateAssets>
44+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
45+
</PackageReference>
3546
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0">
3647
<PrivateAssets>all</PrivateAssets>
3748
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

AutoDbSet/AutoDbSetIncrementalSourceGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public sealed class {{DbContextAttributeName}} : global::System.Attribute
6868
#nullable restore
6969
""";
7070

71-
private record struct DbSetData(string Name, string Namespace, bool IsGlobalNamespace, string? CustomName);
71+
private record DbSetData(string Name, string Namespace, bool IsGlobalNamespace, string? CustomName);
7272

73-
private record struct DbContextData(string Name, string Visibility, string Namespace);
73+
private record DbContextData(string Name, string Visibility, string Namespace);
7474

7575
public void Initialize(IncrementalGeneratorInitializationContext context)
7676
{

0 commit comments

Comments
 (0)