Skip to content

Commit a843f58

Browse files
Migrate Sample app to net8 (#628)
1 parent ca7036e commit a843f58

File tree

4 files changed

+4
-80
lines changed

4 files changed

+4
-80
lines changed

net/Sample/Converters.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

net/Sample/Models/NorthwindContext.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,5 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) {
126126
});
127127
}
128128

129-
#if NET6_0 || NET7_0
130-
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) {
131-
base.ConfigureConventions(configurationBuilder);
132-
configurationBuilder.Properties<DateOnly>().HaveConversion<NetLess8DateOnlyValueConverter>();
133-
configurationBuilder.Properties<TimeOnly>().HaveConversion<NetLess8TimeOnlyValueConverter>();
134-
}
135-
#endif
136-
137129
}
138130
}

net/Sample/Program.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ public static void Main(string[] args) {
77
var builder = WebApplication.CreateBuilder(args);
88
builder.Services
99
.AddControllersWithViews()
10-
//.AddRazorRuntimeCompilation()
11-
#if NET6_0
12-
.AddJsonOptions(options => {
13-
options.JsonSerializerOptions.Converters.Add(new Net6DateOnlyJsonConverter());
14-
options.JsonSerializerOptions.Converters.Add(new Net6TimeOnlyJsonConverter());
15-
})
16-
#endif
17-
;
10+
.AddRazorRuntimeCompilation();
1811
builder.Services
1912
.AddLogging()
2013
.AddEntityFrameworkSqlServer()

net/Sample/Sample.csproj

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<ProjectReference Include="..\DevExtreme.AspNet.Data\DevExtreme.AspNet.Data.csproj" />
1010
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
1111
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
12-
</ItemGroup>
13-
14-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
15-
<DefineConstants>NET6.0</DefineConstants>
16-
</PropertyGroup>
17-
18-
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
19-
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.28" />-->
20-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.28" />
21-
</ItemGroup>
22-
23-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
24-
<DefineConstants>NET7.0</DefineConstants>
25-
</PropertyGroup>
26-
27-
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
28-
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.17" />-->
29-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.17" />
30-
</ItemGroup>
31-
32-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
33-
<DefineConstants>NET8.0</DefineConstants>
34-
</PropertyGroup>
35-
36-
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
37-
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" />-->
38-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
12+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.7" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
3914
</ItemGroup>
4015

4116
<Target Name="Clean dx-aspnet-data-js" BeforeTargets="LibraryManagerRestore">

0 commit comments

Comments
 (0)