Removing .NET 5.0 support - due to EOL (2022-05-10)
https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
|
||||
<AssemblyName>AMWD.Common.AspNetCore</AssemblyName>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
|
||||
<AssemblyName>AMWD.Common.EntityFrameworkCore</AssemblyName>
|
||||
@@ -41,13 +41,6 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using AMWD.Common.EntityFrameworkCore.Attributes;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
#if NET5_0_OR_GREATER
|
||||
#if NET6_0_OR_GREATER
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace AMWD.Common.EntityFrameworkCore.Extensions
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(indexAttribute.Name))
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
#if NET6_0_OR_GREATER
|
||||
index.SetDatabaseName(indexAttribute.Name.Trim());
|
||||
#else
|
||||
index.SetName(indexAttribute.Name.Trim());
|
||||
@@ -61,14 +61,14 @@ namespace AMWD.Common.EntityFrameworkCore.Extensions
|
||||
// skip conversion when table name is explicitly set
|
||||
if ((entityType.ClrType.GetCustomAttribute(typeof(TableAttribute), false) as TableAttribute) == null)
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
#if NET6_0_OR_GREATER
|
||||
entityType.SetTableName(ConvertToSnakeCase(entityType.GetTableName()));
|
||||
#else
|
||||
entityType.SetTableName(ConvertToSnakeCase(entityType.GetTableName()));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NET5_0_OR_GREATER
|
||||
#if NET6_0_OR_GREATER
|
||||
var identifier = StoreObjectIdentifier.Table(entityType.GetTableName(), entityType.GetSchema());
|
||||
#endif
|
||||
foreach (var property in entityType.GetProperties())
|
||||
@@ -76,7 +76,7 @@ namespace AMWD.Common.EntityFrameworkCore.Extensions
|
||||
// skip conversion when column name is explicitly set
|
||||
if ((entityType.ClrType.GetProperty(property.Name)?.GetCustomAttribute(typeof(ColumnAttribute), false) as ColumnAttribute) == null)
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
#if NET6_0_OR_GREATER
|
||||
property.SetColumnName(ConvertToSnakeCase(property.GetColumnName(identifier)));
|
||||
#else
|
||||
property.SetColumnName(ConvertToSnakeCase(property.GetColumnName()));
|
||||
|
||||
Reference in New Issue
Block a user