Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Upgrade to .NET 10#119

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intomaster
base:master
Choose a base branch
Loading
fromcopilot/upgrade-to-dotnet-10
Draft
Show file tree
Hide file tree
Changes fromall 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
2 changes: 1 addition & 1 deletion.github/workflows/dotnetcore.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,5 +11,5 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version:8.0.204
dotnet-version:10.0.100-rc.2.25502.107
- run: dotnet run --project build/build.csproj
2 changes: 1 addition & 1 deletionDirectory.Build.props
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<AnalysisMode>Recommended</AnalysisMode>
<WarningsAsErrors>true</WarningsAsErrors>
Expand Down
22 changes: 17 additions & 5 deletionsDirectory.Packages.props
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,18 +4,30 @@
<PackageVersion Include="Bullseye" Version="6.0.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageVersion Include="Glob" Version="1.1.9" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.13" />
<PackageVersion
Include="Microsoft.AspNetCore.Authentication.JwtBearer"
Version="10.0.0-rc.2.25502.107"
/>
<PackageVersion
Include="Microsoft.EntityFrameworkCore.InMemory"
Version="10.0.0-rc.2.25502.107"
/>
<PackageVersion
Include="Microsoft.EntityFrameworkCore.Sqlite"
Version="10.0.0-rc.2.25502.107"
/>
<PackageVersion
Include="Microsoft.EntityFrameworkCore.SqlServer"
Version="10.0.0-rc.2.25502.107"
/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Serilog" Version="4.3.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="FluentValidation" Version="12.0.0" />
<PackageVersion Include="MediatR" Version="12.5.0" />
<PackageVersion Include="SimpleExec" Version="12.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.4" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="9.0.6" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.1" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletionsDockerfile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.


FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet run --project build/build.csproj -- publish

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base

WORKDIR /app
COPY --from=build /src/publish .
Expand Down
4 changes: 2 additions & 2 deletionsbuild/Program.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,7 +43,7 @@ void RemoveDirectory(string d)
}
);

Target(Build, [Format], () => Run("dotnet", "build. -c Release"));
Target(Build, [Format], () => Run("dotnet", "buildConduit.sln -c Release"));

Target(
Test,
Expand All@@ -67,7 +67,7 @@ void RemoveDirectory(string d)
{
Run(
"dotnet",
$"publish {project} -c Release -fnet8.0 -o ./publish --no-restore --no-build --verbosity=normal"
$"publish {project} -c Release -fnet10.0 -o ./publish --no-restore --no-build --verbosity=normal"
);
}
);
Expand Down
2 changes: 1 addition & 1 deletionbuild/packages.lock.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"version":2,
"dependencies": {
"net8.0": {
"net10.0": {
"Bullseye": {
"type":"Direct",
"requested":"[6.0.0, )",
Expand Down
2 changes: 1 addition & 1 deletionglobal.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.201",
"version": "10.0.100-rc.2.25502.107",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletionsrc/Conduit/Domain/Article.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@ public class Article

[NotMapped]
public List<string> TagList =>
ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!).ToList();
[..ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!)];

[JsonIgnore]
public List<ArticleTag> ArticleTags { get; init; } = new();
Expand Down
2 changes: 1 addition & 1 deletionsrc/Conduit/Features/Articles/Edit.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,7 @@ CancellationToken cancellationToken

// ensure context is tracking any tags that are about to be created so that it won't attempt to insert a duplicate
context.Tags.AttachRange(
articleTagsToCreate.Where(x => x.Tag is not null).Select(a => a.Tag!).ToArray()
[..articleTagsToCreate.Where(x => x.Tag is not null).Select(a => a.Tag!)]
);

// add the new article tags
Expand Down
2 changes: 1 addition & 1 deletionsrc/Conduit/Features/Profiles/IProfileReader.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,5 +5,5 @@ namespace Conduit.Features.Profiles;

public interface IProfileReader
{
Task<ProfileEnvelope> ReadProfile(string username, CancellationToken cancellationToken);
publicTask<ProfileEnvelope> ReadProfile(string username, CancellationToken cancellationToken);
}
14 changes: 6 additions & 8 deletionssrc/Conduit/Features/Users/Login.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,14 +54,12 @@ public async Task<UserEnvelope> Handle(Command message, CancellationToken cancel
);
}

if (
!person.Hash.SequenceEqual(
await passwordHasher.Hash(
message.User.Password ?? throw new InvalidOperationException(),
person.Salt
)
)
)
var hash = await passwordHasher.Hash(
message.User.Password ?? throw new InvalidOperationException(),
person.Salt
);

if (!person.Hash.SequenceEqual(hash))
{
throw new RestException(
HttpStatusCode.Unauthorized,
Expand Down
14 changes: 4 additions & 10 deletionssrc/Conduit/Infrastructure/ConduitContext.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,11 +98,8 @@ public void CommitTransaction()
}
finally
{
if (_currentTransaction != null)
{
_currentTransaction.Dispose();
_currentTransaction = null;
}
_currentTransaction?.Dispose();
_currentTransaction = null;
}
}

Expand All@@ -114,11 +111,8 @@ public void RollbackTransaction()
}
finally
{
if (_currentTransaction != null)
{
_currentTransaction.Dispose();
_currentTransaction = null;
}
_currentTransaction?.Dispose();
_currentTransaction = null;
}
}
#endregion
Expand Down
2 changes: 1 addition & 1 deletionsrc/Conduit/Infrastructure/ICurrentUserAccessor.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ namespace Conduit.Infrastructure;

public interface ICurrentUserAccessor
{
string? GetCurrentUsername();
publicstring? GetCurrentUsername();
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ namespace Conduit.Infrastructure.Security;

public interface IJwtTokenGenerator
{
string CreateToken(string username);
publicstring CreateToken(string username);
}
2 changes: 1 addition & 1 deletionsrc/Conduit/Infrastructure/Security/IPasswordHasher.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,5 +5,5 @@ namespace Conduit.Infrastructure.Security;

public interface IPasswordHasher : IDisposable
{
Task<byte[]> Hash(string password, byte[] salt);
publicTask<byte[]> Hash(string password, byte[] salt);
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ IEnumerable<IValidator<TRequest>> validators
) : IPipelineBehavior<TRequest, TResponse>
where TRequest : notnull
{
private readonly List<IValidator<TRequest>> _validators =validators.ToList();
private readonly List<IValidator<TRequest>> _validators =[.. validators];

public async Task<TResponse> Handle(
TRequest request,
Expand Down
5 changes: 1 addition & 4 deletionssrc/Conduit/Infrastructure/ValidatorActionFilter.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,10 +17,7 @@ public void OnActionExecuting(ActionExecutingContext filterContext)

foreach (var valuePair in filterContext.ModelState)
{
errors.Add(
valuePair.Key,
valuePair.Value.Errors.Select(x => x.ErrorMessage).ToArray()
);
errors.Add(valuePair.Key, [.. valuePair.Value.Errors.Select(x => x.ErrorMessage)]);
}

var content = JsonSerializer.Serialize(new { errors });
Expand Down
2 changes: 1 addition & 1 deletionsrc/Conduit/Program.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -91,7 +91,7 @@
.Services.AddMvc(opt =>
{
opt.Conventions.Add(new GroupByApiRootConvention());
opt.Filters.Add(typeof(ValidatorActionFilter));
opt.Filters.Add<ValidatorActionFilter>();
opt.EnableEndpointRouting = false;
})
.AddJsonOptions(opt =>
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp