Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Sample app to net8 #628

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions net/Sample/Converters.cs

This file was deleted.

8 changes: 0 additions & 8 deletions net/Sample/Models/NorthwindContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,5 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) {
});
}

#if NET6_0 || NET7_0
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) {
base.ConfigureConventions(configurationBuilder);
configurationBuilder.Properties<DateOnly>().HaveConversion<NetLess8DateOnlyValueConverter>();
configurationBuilder.Properties<TimeOnly>().HaveConversion<NetLess8TimeOnlyValueConverter>();
}
#endif

}
}
9 changes: 1 addition & 8 deletions net/Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ public static void Main(string[] args) {
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddControllersWithViews()
//.AddRazorRuntimeCompilation()
#if NET6_0
.AddJsonOptions(options => {
options.JsonSerializerOptions.Converters.Add(new Net6DateOnlyJsonConverter());
options.JsonSerializerOptions.Converters.Add(new Net6TimeOnlyJsonConverter());
})
#endif
;
.AddRazorRuntimeCompilation();
builder.Services
.AddLogging()
.AddEntityFrameworkSqlServer()
Expand Down
31 changes: 3 additions & 28 deletions net/Sample/Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\DevExtreme.AspNet.Data\DevExtreme.AspNet.Data.csproj" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<DefineConstants>NET6.0</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.28" />-->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.28" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<DefineConstants>NET7.0</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.17" />-->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.17" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<DefineConstants>NET8.0</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" />-->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
</ItemGroup>

<Target Name="Clean dx-aspnet-data-js" BeforeTargets="LibraryManagerRestore">
Expand Down
Loading