Skip to content

Commit

Permalink
Add .net 7.0 TFM to all projects (except benchmark) whilst maintainin…
Browse files Browse the repository at this point in the history
…g .net 6 TFM. Also fix AddProblemDetails in sample project to use thrid party extension in .net 6 and built in service in .net 7 (doing this avoids naming collision).
  • Loading branch information
pippipmilk committed Nov 14, 2022
1 parent 16d81ab commit e407f6e
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<UseNETCoreGenerator>true</UseNETCoreGenerator>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ExpressionDebugger/ExpressionDebugger.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>Chaowlert Chaisrichalermpol</Authors>
<Description>Step into debugging from linq expressions</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/ExpressionTranslator/ExpressionTranslator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>Chaowlert Chaisrichalermpol</Authors>
<Description>Translate from linq expressions to C# code</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Async.Tests/Mapster.Async.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Async/Mapster.Async.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>Async supports for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;Async</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Core/Mapster.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Lightweight library for Mapster and Mapster CodeGen</Description>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<AssemblyName>Mapster.Core</AssemblyName>
<PackageTags>mapster</PackageTags>
<Version>1.2.1-pre02</Version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>Dependency Injection supports for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;DependencyInjection</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.EF6/Mapster.EF6.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>EF6 plugin for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;EF6</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.EFCore.Tests/Mapster.EFCore.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.EFCore/Mapster.EFCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>EFCore plugin for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;EFCore</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Immutable.Tests/Mapster.Immutable.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Immutable/Mapster.Immutable.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>Immutable collection supports for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;Immutable</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.JsonNet.Tests/Mapster.JsonNet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.JsonNet/Mapster.JsonNet.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>Json.net conversion supports for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;Json.net</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.SourceGenerator/Mapster.SourceGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Description>Source generator to generate mapping using Mapster</Description>
<PackageTags>source-generator;mapster</PackageTags>
<SignAssembly>true</SignAssembly>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Tests/Mapster.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<AssemblyName>Mapster.Tests</AssemblyName>
<AssemblyOriginatorKeyFile>Mapster.Tests.snk</AssemblyOriginatorKeyFile>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster.Tool/Mapster.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-mapster</ToolCommandName>
Expand Down
2 changes: 1 addition & 1 deletion src/Mapster/Mapster.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>A fast, fun and stimulating object to object mapper. Kind of like AutoMapper, just simpler and way, way faster.</Description>
<Copyright>Copyright (c) 2016 Chaowlert Chaisrichalermpol, Eric Swann</Copyright>
<Authors>chaowlert;eric_swann</Authors>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<AssemblyName>Mapster</AssemblyName>
<Description>A fast, fun and stimulating object to object mapper. Kind of like AutoMapper, just simpler and way, way faster.</Description>
<PackageId>Mapster</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion src/Sample.AspNetCore/Sample.AspNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/Sample.AspNetCore/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Linq.Expressions;
using ExpressionDebugger;
#if NET6_0
using Hellang.Middleware.ProblemDetails;
#endif
using Mapster;
using Sample.AspNetCore.Controllers;
using Sample.AspNetCore.Models;
Expand Down Expand Up @@ -69,7 +71,9 @@ private static TypeAdapterConfig GetConfiguredMappingConfig()
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
#if NET6_0
app.UseProblemDetails();
#endif
app.UseRouting();
app.UseAuthorization();
app.UseMvc();
Expand Down
2 changes: 1 addition & 1 deletion src/Sample.CodeGen/Sample.CodeGen.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

Expand Down
5 changes: 5 additions & 0 deletions src/Sample.CodeGen/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#if NET6_0
using Hellang.Middleware.ProblemDetails;
#endif
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.OData;
Expand Down Expand Up @@ -27,6 +29,7 @@ public void ConfigureServices(IServiceCollection services)
.AddNewtonsoftJson();
services.AddDbContext<SchoolContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

services.AddProblemDetails();
services.Scan(selector => selector.FromCallingAssembly()
.AddClasses().AsMatchingInterface().WithSingletonLifetime());
Expand All @@ -35,7 +38,9 @@ public void ConfigureServices(IServiceCollection services)
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
#if NET6_0
app.UseProblemDetails();
#endif
app.UseRouting();
app.UseAuthorization();
app.UseMvc();
Expand Down
2 changes: 1 addition & 1 deletion src/TemplateTest/TemplateTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
Expand Down

0 comments on commit e407f6e

Please sign in to comment.