Skip to content

Commit

Permalink
feat: upgrade to dotnet 8
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-shirbandi committed Sep 5, 2024
1 parent 4dc5508 commit 759036d
Show file tree
Hide file tree
Showing 49 changed files with 73 additions and 87 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ dotnet_diagnostic.IDE0058.severity = silent # Expression value is never used
dotnet_diagnostic.IDE0072.severity = silent # missing cases to "=>" switch expression
dotnet_diagnostic.IDE0090.severity = silent # Use implicit new
dotnet_diagnostic.IDE0270.severity = silent # Simplify null check
dotnet_diagnostic.IDE0290.severity = silent # Use primary constructor
dotnet_diagnostic.IDE0028.severity = silent # Use collection initializers or expressions
dotnet_diagnostic.IDE0301.severity = silent # Use collection expression for empty
dotnet_diagnostic.IDE0300.severity = silent # Use collection expression for array
dotnet_diagnostic.CA1859.severity = silent # Use concrete types when possible for improved performance



# https://github.com/dotnet/aspnetcore/issues/47912
dotnet_diagnostic.IDE0005.severity = none # Remove unnecessary using directives (using CS8019 instead)
dotnet_diagnostic.CS8019.severity = error # Remove unnecessary using directives
Expand Down
2 changes: 1 addition & 1 deletion src/1-BuildingBlocks/Application/Application.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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.BuildingBlocks.Application</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Application</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/1-BuildingBlocks/Contracts/Contracts.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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.BuildingBlocks.Contracts</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Contracts</RootNamespace>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/1-BuildingBlocks/Domain/Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.BuildingBlocks.Domain</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Domain</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="MongoDB.Driver" Version="2.17.0" />
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/1-BuildingBlocks/Infrastructure/Infrastructure.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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.BuildingBlocks.Infrastructure</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Infrastructure</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/1-BuildingBlocks/Test/Test.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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.BuildingBlocks.Test</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Test</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/1-BuildingBlocks/Web.MVC/Web.MVC.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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.BuildingBlocks.Web.MVC</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Web.MVC</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/1-BuildingBlocks/Web/Web.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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.BuildingBlocks.Web</AssemblyName>
<RootNamespace>TaskoMask.BuildingBlocks.Web</RootNamespace>
Expand Down
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Boards.Read.Api</AssemblyName>
<RootNamespace>TaskoMask.Services.Boards.Read.Api</RootNamespace>
<UserSecretsId>ad97a501-340f-470b-bd59-307501d3568c</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
Expand All @@ -17,13 +16,13 @@ public static class GrpcExtensions
/// <summary>
///
/// </summary>
public static void MapGrpcServices(this IEndpointRouteBuilder endpoints)
public static void MapGrpcServices(this WebApplication app)
{
endpoints.MapGrpcService<GetBoardByIdGrpcEndpoint>();
endpoints.MapGrpcService<GetCardsByBoardIdGrpcEndpoint>();
endpoints.MapGrpcService<GetBoardsByProjectIdGrpcEndpoint>();
endpoints.MapGrpcService<GetBoardsByOrganizationIdGrpcEndpoint>();
endpoints.MapGrpcService<GetCardByIdGrpcEndpoint>();
app.MapGrpcService<GetBoardByIdGrpcEndpoint>();
app.MapGrpcService<GetCardsByBoardIdGrpcEndpoint>();
app.MapGrpcService<GetBoardsByProjectIdGrpcEndpoint>();
app.MapGrpcService<GetBoardsByOrganizationIdGrpcEndpoint>();
app.MapGrpcService<GetCardByIdGrpcEndpoint>();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ public static WebApplication ConfigurePipeline(this WebApplication app, IConfigu

app.Services.InitialDatabase();

app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapGrpcServices();
});
app.MapControllers();

app.MapGrpcServices();

return app;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
Expand All @@ -10,7 +9,7 @@

namespace TaskoMask.Services.Boards.Read.Api.Features.Boards.GetBoardById;

[Authorize("user-read-access")]
//[Authorize("user-read-access")]
[Tags("Boards")]
public class GetBoardByIdRestEndpoint : BaseApiController
{
Expand Down
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Boards.Write.Api</AssemblyName>
<RootNamespace>TaskoMask.Services.Boards.Write.Api</RootNamespace>
<UserSecretsId>c9714a06-4333-446f-831c-ea6b0c311bb3</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app, IConfigu

app.Services.InitialDatabasesAndSeedEssentialData();

app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.MapControllers();

return app;
}
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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.Services.Boards.Read.Tests.Integration</AssemblyName>
<RootNamespace>TaskoMask.Services.Boards.Read.Tests.Integration</RootNamespace>
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Boards.Write.Tests.Base</AssemblyName>
<RootNamespace>TaskoMask.Services.Boards.Write.Tests.Base</RootNamespace>
</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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.Services.Boards.Write.Tests.Integration</AssemblyName>
<RootNamespace>TaskoMask.Services.Boards.Write.Tests.Integration</RootNamespace>
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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.Services.Boards.Write.Tests.Unit</AssemblyName>
<RootNamespace>TaskoMask.Services.Boards.Write.Tests.Unit</RootNamespace>
Expand Down
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Identity.Api</AssemblyName>
<RootNamespace>TaskoMask.Services.Identity.Api</RootNamespace>
<UserSecretsId>755a7a1d-10e7-4626-9a60-81b74933b0b3</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See LICENSE in the project root for license information.


using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.RazorPages;

Expand All @@ -17,13 +18,13 @@ public override void OnResultExecuting(ResultExecutingContext context)
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options"))
{
context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff");
context.HttpContext.Response.Headers.Append("X-Content-Type-Options", "nosniff");
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
if (!context.HttpContext.Response.Headers.ContainsKey("X-Frame-Options"))
{
context.HttpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
context.HttpContext.Response.Headers.Append("X-Frame-Options", "SAMEORIGIN");
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Expand All @@ -37,19 +38,19 @@ public override void OnResultExecuting(ResultExecutingContext context)
// once for standards compliant browsers
if (!context.HttpContext.Response.Headers.ContainsKey("Content-Security-Policy"))
{
context.HttpContext.Response.Headers.Add("Content-Security-Policy", csp);
context.HttpContext.Response.Headers.Append("Content-Security-Policy", csp);
}
// and once again for IE
if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Security-Policy"))
{
context.HttpContext.Response.Headers.Add("X-Content-Security-Policy", csp);
context.HttpContext.Response.Headers.Append("X-Content-Security-Policy", csp);
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
var referrer_policy = "no-referrer";
if (!context.HttpContext.Response.Headers.ContainsKey("Referrer-Policy"))
{
context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy);
context.HttpContext.Response.Headers.Append("Referrer-Policy", referrer_policy);
}
}
}
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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.Services.Identity.Tests.Integration</AssemblyName>
<RootNamespace>TaskoMask.Services.Identity.Tests.Integration</RootNamespace>
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Identity.Tests.Unit</AssemblyName>
<RootNamespace>TaskoMask.Services.Identity.Tests.Unit</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ public static WebApplication ConfigurePipeline(this WebApplication app, IConfigu

app.Services.InitialDatabase();

app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcServices();
endpoints.MapControllers();
});
app.MapGrpcServices();

app.MapControllers();

return app;
}
Expand Down
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Owners.Read.Api</AssemblyName>
<RootNamespace>TaskoMask.Services.Owners.Read.Api</RootNamespace>
<UserSecretsId>5a6364b4-cc6f-4fa9-b2d3-b0040526bb00</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app, IConfigu

app.Services.InitialDatabasesAndSeedEssentialData();

app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.MapControllers();

return app;
}
Expand Down
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Owners.Write.Api</AssemblyName>
<RootNamespace>TaskoMask.Services.Owners.Write.Api</RootNamespace>
<UserSecretsId>0dd4049d-0324-4ff6-8a77-9a1b9cf12f56</UserSecretsId>
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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.Services.Owners.Read.IntegrationTests</AssemblyName>
<RootNamespace>TaskoMask.Services.Owners.Read.IntegrationTests</RootNamespace>
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Owners.Write.Tests.Base</AssemblyName>
<RootNamespace>TaskoMask.Services.Owners.Write.Tests.Base</RootNamespace>

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>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TaskoMask.Services.Owners.Write.Tests.Integration</AssemblyName>
<RootNamespace>TaskoMask.Services.Owners.Write.Tests.Integration</RootNamespace>
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Owners.Write.Tests.Unit</AssemblyName>
<RootNamespace>TaskoMask.Services.Owners.Write.Tests.Unit</RootNamespace>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ public static WebApplication ConfigurePipeline(this WebApplication app, IConfigu

app.Services.InitialDatabase();

app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcServices();
endpoints.MapControllers();
});
app.MapGrpcServices();

app.MapControllers();

return app;
}
Expand Down
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>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>TaskoMask.Services.Tasks.Read.Api</AssemblyName>
<RootNamespace>TaskoMask.Services.Tasks.Read.Api</RootNamespace>
<UserSecretsId>cd2a900c-efdb-4190-8884-a22c88d254ae</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app, IConfigu

app.Services.InitialDatabasesAndSeedEssentialData();

app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.MapControllers();

return app;
}
Expand Down
Loading

0 comments on commit 759036d

Please sign in to comment.