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

#226 - Migration from .NET 7.0 to .NET 8.0 #225

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .azure/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ steps:
displayName: 'docker compose -f ./docker-compose/docker-compose.tests.yml up -d'

- task: UseDotNet@2
displayName: 'install .net sdk 7.x'
displayName: 'install .net sdk 8.x'
inputs:
version: 7.x
version: 8.x
installationPath: $(Agent.ToolsDirectory)/dotnet

- script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: docker compose -f ./docker-compose/docker-compose.tests.yml up -d
run: docker compose -f ./docker-compose/docker-compose.tests.yml up -d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Setup NuGet
uses: nuget/setup-nuget@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using EntityFrameworkCore.EncryptColumn.Util;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Interfaces;
using OnlineSales.Plugin.EmailSync.Entities;
Expand All @@ -22,8 +23,8 @@ public EmailSyncDbContext()
{
}

public EmailSyncDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public EmailSyncDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
var key = configuration.GetSection("EmailSync:EncryptionKey").Get<string>();
if (key == null )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<Nullable>enable</Nullable>
Expand Down
5 changes: 3 additions & 2 deletions plugins/OnlineSales.Plugin.SendGrid/Data/SendgridDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Interfaces;
using OnlineSales.Plugin.SendGrid.Entities;
Expand All @@ -17,8 +18,8 @@ public SendgridDbContext()
{
}

public SendgridDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public SendgridDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
}

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
5 changes: 3 additions & 2 deletions plugins/OnlineSales.Plugin.Sms/Data/SmsDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Plugin.Sms.Entities;

namespace OnlineSales.Plugin.Sms.Data;

public class SmsDbContext : PluginDbContextBase
{
public SmsDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public SmsDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
}

Expand Down
5 changes: 0 additions & 5 deletions plugins/OnlineSales.Plugin.Sms/Exceptions/AwsSnsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ public AwsSnsException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected AwsSnsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,4 @@ public GetshoutoutException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected GetshoutoutException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ public NotifyLkException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected NotifyLkException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ public SmsPluginException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected SmsPluginException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
5 changes: 0 additions & 5 deletions plugins/OnlineSales.Plugin.Sms/Exceptions/SmscException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@ public SmscException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected SmscException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
5 changes: 0 additions & 5 deletions plugins/OnlineSales.Plugin.Sms/Exceptions/TwilioException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ public TwilioException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected TwilioException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,5 @@ public UnknownCountryCodeException(string? message, Exception? innerException)
: base(message, innerException)
{
}

protected UnknownCountryCodeException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 0 additions & 2 deletions plugins/OnlineSales.Plugin.Sms/Services/SmscService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
// </copyright>

using System.Reflection;
using System.Web;
using Newtonsoft.Json;
using OnlineSales.Plugin.Sms.Configuration;
using OnlineSales.Plugin.Sms.Exceptions;
using Serilog;

namespace OnlineSales.Plugin.Sms.Services;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
// </copyright>

using System.Data.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Interfaces;
using OnlineSales.Plugin.TestPlugin.Entities;
Expand All @@ -23,8 +25,8 @@ public TestPluginDbContext()
migrations = new SortedSet<string>();
}

public TestPluginDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public TestPluginDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
migrations = new SortedSet<string>(Database.GetPendingMigrations());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
5 changes: 3 additions & 2 deletions plugins/OnlineSales.Plugin.Vsto/Data/VstoDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql;
using OnlineSales.Data;
using OnlineSales.Plugin.Vsto.Entities;

Expand All @@ -16,8 +17,8 @@ public VstoDbContext()
{
}

public VstoDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper)
: base(options, configuration, httpContextHelper)
public VstoDbContext(DbContextOptions<PgDbContext> options, IConfiguration configuration, IHttpContextHelper httpContextHelper, NpgsqlDataSource dataSource)
: base(options, configuration, httpContextHelper, dataSource)
{
}

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 0 additions & 2 deletions src/OnlineSales/Controllers/AccountsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using AutoMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using OnlineSales.Configuration;
using OnlineSales.Data;
using OnlineSales.DTOs;
using OnlineSales.Entities;
Expand Down
4 changes: 2 additions & 2 deletions src/OnlineSales/Controllers/ActivityLogController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public virtual async Task<ActionResult<List<ActivityLogDetailsDto>>> Get([FromQu
var qp = queryProviderFactory.BuildQueryProvider();

var result = await qp.GetResult();
Response.Headers.Add(ResponseHeaderNames.TotalCount, result.TotalCount.ToString());
Response.Headers.Add(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
Response.Headers.Append(ResponseHeaderNames.TotalCount, result.TotalCount.ToString());
Response.Headers.Append(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
return Ok(mapper.Map<List<ActivityLogDetailsDto>>(result.Records));
}
}
8 changes: 4 additions & 4 deletions src/OnlineSales/Controllers/BaseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public virtual async Task<ActionResult<List<TD>>> Get([FromQuery] string? query)
var qp = queryProviderFactory.BuildQueryProvider();

var result = await qp.GetResult();
Response.Headers.Add(ResponseHeaderNames.TotalCount, result.TotalCount.ToString());
Response.Headers.Add(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
Response.Headers.Append(ResponseHeaderNames.TotalCount, result.TotalCount.ToString());
Response.Headers.Append(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
var res = mapper.Map<List<TD>>(result.Records);
RemoveSecondLevelObjects(res);
return Ok(res);
Expand All @@ -120,8 +120,8 @@ public virtual async Task<ActionResult<List<TD>>> Export([FromQuery] string? que
var qp = queryProviderFactory.BuildQueryProvider(int.MaxValue);

var result = await qp.GetResult();
Response.Headers.Add(ResponseHeaderNames.TotalCount, result.TotalCount.ToString());
Response.Headers.Add(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
Response.Headers.Append(ResponseHeaderNames.TotalCount, result.TotalCount.ToString());
Response.Headers.Append(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
var res = mapper.Map<List<TD>>(result.Records);
RemoveSecondLevelObjects(res);
return Ok(res);
Expand Down
4 changes: 2 additions & 2 deletions src/OnlineSales/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public async Task<ActionResult<UserDetailsDto[]>> GetAll()
{
var allUsers = await userManager.Users.ToListAsync();
var resultsToClient = mapper.Map<UserDetailsDto[]>(allUsers).ToArray();
Response.Headers.Add(ResponseHeaderNames.TotalCount, resultsToClient.Count().ToString());
Response.Headers.Add(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
Response.Headers.Append(ResponseHeaderNames.TotalCount, resultsToClient.Count().ToString());
Response.Headers.Append(ResponseHeaderNames.AccessControlExposeHeader, ResponseHeaderNames.TotalCount);
return Ok(resultsToClient);
}

Expand Down
3 changes: 0 additions & 3 deletions src/OnlineSales/Data/EsDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
// </copyright>

using System;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Nest;
using OnlineSales.Configuration;
using OnlineSales.DataAnnotations;
Expand Down
Loading
Loading