Skip to content

Commit 5f76a4c

Browse files
authored
Merge pull request #109 from gothinkster/dotnet-8
Dotnet 8
2 parents 5ebcd27 + acf83d8 commit 5f76a4c

File tree

84 files changed

+973
-2418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+973
-2418
lines changed

.config/dotnet-tools.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"isRoot": true,
44
"tools": {
55
"csharpier": {
6-
"version": "0.25.0",
6+
"version": "0.27.3",
77
"commands": [
88
"dotnet-csharpier"
99
]
1010
}
1111
}
12-
}
12+
}

.github/workflows/dotnetcore.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- uses: actions/setup-dotnet@v4
1313
with:
14-
dotnet-version: 7.0.400
15-
- run: dotnet run -p build/build.csproj
14+
dotnet-version: 8.0.201
15+
- run: dotnet run --project build/build.csproj

Conduit.sln

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{E0DF0C
1818
Directory.Packages.props = Directory.Packages.props
1919
Directory.Build.props = Directory.Build.props
2020
global.json = global.json
21+
.editorconfig = .editorconfig
2122
EndProjectSection
2223
EndProject
2324
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{79EC8D73-8DAD-430E-93CE-C1F29DBC33FA}"

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
<Nullable>enable</Nullable>
55
<AnalysisMode>Recommended</AnalysisMode>
66
<WarningsAsErrors>true</WarningsAsErrors>

Directory.Packages.props

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="AutoMapper" Version="12.0.1" />
4-
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
5-
<PackageVersion Include="Bullseye" Version="4.2.1" />
3+
<PackageVersion Include="AutoMapper" Version="13.0.1" />
4+
<PackageVersion Include="Bullseye" Version="5.0.0" />
65
<PackageVersion Include="Glob" Version="1.1.9" />
7-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.10" />
8-
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.10" />
9-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10" />
10-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.10" />
11-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
12-
<PackageVersion Include="Serilog" Version="3.0.1" />
13-
<PackageVersion Include="Serilog.Extensions.Logging" Version="7.0.0" />
14-
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0" />
6+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.2" />
7+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.2" />
8+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />
9+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
10+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
11+
<PackageVersion Include="Serilog" Version="3.1.1" />
12+
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
13+
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.1" />
1514
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
16-
<PackageVersion Include="MediatR" Version="12.1.1" />
17-
<PackageVersion Include="SimpleExec" Version="11.0.0" />
15+
<PackageVersion Include="MediatR" Version="12.2.0" />
16+
<PackageVersion Include="SimpleExec" Version="12.0.0" />
1817
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
19-
<PackageVersion Include="xunit" Version="2.5.0" />
20-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0"/>
18+
<PackageVersion Include="xunit" Version="2.7.0" />
19+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7"/>
2120
</ItemGroup>
2221
</Project>

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#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.
22

3-
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base
3+
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
44
WORKDIR /app
55

6-
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
6+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
77
WORKDIR /src
88
COPY ["build/build.csproj", "build/"]
99
RUN dotnet restore "build/build.csproj"

build/Program.cs

+3-9
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
ForEach("publish", "**/bin", "**/obj"),
1717
dir =>
1818
{
19-
IEnumerable<string> GetDirectories(string d)
20-
{
21-
return Glob.Directories(".", d);
22-
}
19+
IEnumerable<string> GetDirectories(string d) => Glob.Directories(".", d);
2320

2421
void RemoveDirectory(string d)
2522
{
@@ -53,10 +50,7 @@ void RemoveDirectory(string d)
5350
DependsOn(Build),
5451
() =>
5552
{
56-
IEnumerable<string> GetFiles(string d)
57-
{
58-
return Glob.Files(".", d);
59-
}
53+
IEnumerable<string> GetFiles(string d) => Glob.Files(".", d);
6054

6155
foreach (var file in GetFiles("tests/**/*.csproj"))
6256
{
@@ -73,7 +67,7 @@ IEnumerable<string> GetFiles(string d)
7367
{
7468
Run(
7569
"dotnet",
76-
$"publish {project} -c Release -f net7.0 -o ./publish --no-restore --no-build --verbosity=normal"
70+
$"publish {project} -c Release -f net8.0 -o ./publish --no-restore --no-build --verbosity=normal"
7771
);
7872
}
7973
);

build/packages.lock.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"version": 2,
33
"dependencies": {
4-
"net7.0": {
4+
"net8.0": {
55
"Bullseye": {
66
"type": "Direct",
7-
"requested": "[4.2.1, )",
8-
"resolved": "4.2.1",
9-
"contentHash": "LQ/YuE1TSxCPfn5qGwf7RpS4jGhXEES1ylsHUNbPKdyJqbh+3VRLcxhS2aUHM9wOKaLR7uISuaiHBYc5Idfatw=="
7+
"requested": "[5.0.0, )",
8+
"resolved": "5.0.0",
9+
"contentHash": "bqyt+m17ym+5aN45C5oZRAjuLDt8jKiCm/ys1XfymIXSkrTFwvI/QsbY3ucPSHDz7SF7uON7B57kXFv5H2k1ew=="
1010
},
1111
"Glob": {
1212
"type": "Direct",
@@ -16,9 +16,9 @@
1616
},
1717
"SimpleExec": {
1818
"type": "Direct",
19-
"requested": "[11.0.0, )",
20-
"resolved": "11.0.0",
21-
"contentHash": "4r/YxcXlD9yk0XGdU07gUFey6ZiWu7LxG76l9d9xTDfObOcLvug1Xa9loQYuqs2nEviyTgicD1Svragh2qzlOA=="
19+
"requested": "[12.0.0, )",
20+
"resolved": "12.0.0",
21+
"contentHash": "ptxlWtxC8vM6Y6e3h9ZTxBBkOWnWrm/Sa1HT+2i1xcXY3Hx2hmKDZP5RShPf8Xr9D+ivlrXNy57ktzyH8kyt+Q=="
2222
}
2323
}
2424
}

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "7.0.306",
3+
"version": "8.0.201",
44
"rollForward": "latestFeature"
55
}
66
}

src/Conduit/Conduit.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<ItemGroup>
33
<PackageReference Include="AutoMapper" />
4-
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" />
54
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
65
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
76
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />

src/Conduit/Domain/Article.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Conduit.Domain;
99
public class Article
1010
{
1111
[JsonIgnore]
12-
public int ArticleId { get; set; }
12+
public int ArticleId { get; init; }
1313

1414
public string? Slug { get; set; }
1515

@@ -19,12 +19,12 @@ public class Article
1919

2020
public string? Body { get; set; }
2121

22-
public Person? Author { get; set; }
22+
public Person? Author { get; init; }
2323

24-
public List<Comment> Comments { get; set; } = new();
24+
public List<Comment> Comments { get; init; } = new();
2525

2626
[NotMapped]
27-
public bool Favorited => ArticleFavorites?.Any() ?? false;
27+
public bool Favorited => ArticleFavorites.Count != 0;
2828

2929
[NotMapped]
3030
public int FavoritesCount => ArticleFavorites?.Count ?? 0;
@@ -34,12 +34,12 @@ public class Article
3434
ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!).ToList();
3535

3636
[JsonIgnore]
37-
public List<ArticleTag> ArticleTags { get; set; } = new();
37+
public List<ArticleTag> ArticleTags { get; init; } = new();
3838

3939
[JsonIgnore]
40-
public List<ArticleFavorite> ArticleFavorites { get; set; } = new();
40+
public List<ArticleFavorite> ArticleFavorites { get; init; } = new();
4141

42-
public DateTime CreatedAt { get; set; }
42+
public DateTime CreatedAt { get; init; }
4343

4444
public DateTime UpdatedAt { get; set; }
45-
}
45+
}

src/Conduit/Domain/ArticleFavorite.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ namespace Conduit.Domain;
22

33
public class ArticleFavorite
44
{
5-
public int ArticleId { get; set; }
6-
public Article? Article { get; set; }
5+
public int ArticleId { get; init; }
6+
public Article? Article { get; init; }
77

8-
public int PersonId { get; set; }
9-
public Person? Person { get; set; }
10-
}
8+
public int PersonId { get; init; }
9+
public Person? Person { get; init; }
10+
}

src/Conduit/Domain/ArticleTag.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ namespace Conduit.Domain;
22

33
public class ArticleTag
44
{
5-
public int ArticleId { get; set; }
6-
public Article? Article { get; set; }
5+
public int ArticleId { get; init; }
6+
public Article? Article { get; init; }
77

8-
public string? TagId { get; set; }
9-
public Tag? Tag { get; set; }
10-
}
8+
public string? TagId { get; init; }
9+
public Tag? Tag { get; init; }
10+
}

src/Conduit/Domain/Comment.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ namespace Conduit.Domain;
66
public class Comment
77
{
88
[JsonPropertyName("id")]
9-
public int CommentId { get; set; }
9+
public int CommentId { get; init; }
1010

11-
public string? Body { get; set; }
11+
public string? Body { get; init; }
1212

13-
public Person? Author { get; set; }
13+
public Person? Author { get; init; }
1414

1515
[JsonIgnore]
16-
public int AuthorId { get; set; }
16+
public int AuthorId { get; init; }
1717

1818
[JsonIgnore]
19-
public Article? Article { get; set; }
19+
public Article? Article { get; init; }
2020

2121
[JsonIgnore]
22-
public int ArticleId { get; set; }
22+
public int ArticleId { get; init; }
2323

24-
public DateTime CreatedAt { get; set; }
24+
public DateTime CreatedAt { get; init; }
2525

26-
public DateTime UpdatedAt { get; set; }
27-
}
26+
public DateTime UpdatedAt { get; init; }
27+
}

src/Conduit/Domain/FollowedPeople.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ namespace Conduit.Domain;
22

33
public class FollowedPeople
44
{
5-
public int ObserverId { get; set; }
6-
public Person? Observer { get; set; }
5+
public int ObserverId { get; init; }
6+
public Person? Observer { get; init; }
77

8-
public int TargetId { get; set; }
9-
public Person? Target { get; set; }
10-
}
8+
public int TargetId { get; init; }
9+
public Person? Target { get; init; }
10+
}

src/Conduit/Domain/Person.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Conduit.Domain;
77
public class Person
88
{
99
[JsonIgnore]
10-
public int PersonId { get; set; }
10+
public int PersonId { get; init; }
1111

1212
public string? Username { get; set; }
1313

@@ -18,17 +18,17 @@ public class Person
1818
public string? Image { get; set; }
1919

2020
[JsonIgnore]
21-
public List<ArticleFavorite> ArticleFavorites { get; set; } = new();
21+
public List<ArticleFavorite> ArticleFavorites { get; init; } = new();
2222

2323
[JsonIgnore]
24-
public List<FollowedPeople> Following { get; set; } = new();
24+
public List<FollowedPeople> Following { get; init; } = new();
2525

2626
[JsonIgnore]
27-
public List<FollowedPeople> Followers { get; set; } = new();
27+
public List<FollowedPeople> Followers { get; init; } = new();
2828

2929
[JsonIgnore]
30-
public byte[] Hash { get; set; } = Array.Empty<byte>();
30+
public byte[] Hash { get; set; } = [];
3131

3232
[JsonIgnore]
33-
public byte[] Salt { get; set; } = Array.Empty<byte>();
34-
}
33+
public byte[] Salt { get; set; } = [];
34+
}

src/Conduit/Domain/Tag.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Conduit.Domain;
44

55
public class Tag
66
{
7-
public string? TagId { get; set; }
7+
public string? TagId { get; init; }
88

9-
public List<ArticleTag> ArticleTags { get; set; } = new();
10-
}
9+
public List<ArticleTag> ArticleTags { get; init; } = new();
10+
}

src/Conduit/Features/Articles/ArticleEnvelope.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
namespace Conduit.Features.Articles;
44

5-
public record ArticleEnvelope(Article Article);
5+
public record ArticleEnvelope(Article Article);

0 commit comments

Comments
 (0)