Skip to content

Commit

Permalink
Migrate Sample app to net8 (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpreyskurantov authored Jul 19, 2024
1 parent ca7036e commit a843f58
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 80 deletions.
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

0 comments on commit a843f58

Please sign in to comment.