Skip to content

Commit

Permalink
- 优化 DynamicEntity 扩展方法使用范围,支持net45+
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Nov 20, 2023
1 parent 6f0f874 commit e236a1a
Show file tree
Hide file tree
Showing 3 changed files with 313 additions and 246 deletions.
4 changes: 2 additions & 2 deletions FreeSql/Extensions/DynamicEntityExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// by: Daily

#if net40 || NETSTANDARD2_0
#if net40
#else

using FreeSql;
Expand Down Expand Up @@ -406,7 +406,7 @@ public TableInfo Build()
SetPropertys(ref typeBuilder);

//创建类的Type对象
var type = typeBuilder.CreateType();
var type = typeBuilder.CreateTypeInfo().AsType();

return _fsql.CodeFirst.GetTableByEntity(type);
}
Expand Down
55 changes: 30 additions & 25 deletions FreeSql/FreeSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,51 +33,56 @@
</ItemGroup>

<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>

<ItemGroup>
<Compile Update="Internal\CommonProvider\SelectProvider\Select1Provider2`16.cs">
<DependentUpon>Select1Provider2`16.tt</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\CoreStrings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CoreStrings.Designer.tt</DependentUpon>
</Compile>
<Compile Update="Internal\CommonProvider\SelectProvider\Select1Provider2`16.cs">
<DependentUpon>Select1Provider2`16.tt</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\CoreStrings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CoreStrings.Designer.tt</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Internal\CommonProvider\SelectProvider\T4Temp\ISelect2`16.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>ISelect2`16.cs</LastGenOutput>
</None>
<None Update="Internal\CommonProvider\SelectProvider\T4Temp\Select1Provider2`16.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Select1Provider2`16.cs</LastGenOutput>
</None>
<None Update="Properties\CoreStrings.Designer.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>CoreStrings.Designer.cs</LastGenOutput>
</None>
<None Update="Internal\CommonProvider\SelectProvider\T4Temp\ISelect2`16.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>ISelect2`16.cs</LastGenOutput>
</None>
<None Update="Internal\CommonProvider\SelectProvider\T4Temp\Select1Provider2`16.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Select1Provider2`16.cs</LastGenOutput>
</None>
<None Update="Properties\CoreStrings.Designer.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>CoreStrings.Designer.cs</LastGenOutput>
</None>
<EmbeddedResource Update="Properties\CoreStrings.resx">
<CustomToolNamespace>FreeSql</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>FreeSql.xml</DocumentationFile>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net40'">
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net40'">
<DefineConstants>net40</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
<DefineConstants>net45</DefineConstants>
</PropertyGroup>

</Project>

Loading

0 comments on commit e236a1a

Please sign in to comment.