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