Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: linkdotnet/Blog
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.1
Choose a base ref
...
head repository: linkdotnet/Blog
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 366 changed files with 19,636 additions and 11,863 deletions.
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/dotnet/sdk:9.0",
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "latest"
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit",
"yzhang.markdown-all-in-one",
"vscode-icons-team.vscode-icons",
"me-dutour-mathieu.vscode-github-actions"
]
}
},

"postCreateCommand": "dotnet dev-certs https --trust",
"portsAttributes": {
"5001": {
"protocol": "https"
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
35 changes: 20 additions & 15 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -397,36 +397,33 @@ dotnet_naming_rule.parameters_rule.severity = warning
# Code Analyzers Rules
##########################################

# AsyncFixer
# http://www.asyncfixer.com


# Meziantou
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm
dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md
dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md
dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md
dotnet_diagnostic.MA0028.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0028.md


# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
dotnet_diagnostic.CA1515.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1515.md
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md


# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
dotnet_diagnostic.S1118.severity = none # Add a 'protected' constructor or the 'static' keyword to the class declaration.
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
dotnet_diagnostic.S2583.severity = suggestion # Change this condition so that it does not always evaluate to 'False'.
dotnet_diagnostic.S3875.severity = none # Remove this overload of 'operator =='.

##########################################
# Custom - Code Analyzers Rules
##########################################

# Visual Studio
dotnet_diagnostic.IDE0005.severity = none # IDE0005: Using directive is unnecessary
dotnet_diagnostic.IDE0035.severity = warning # IDE0035: Remove unreachable code
dotnet_diagnostic.IDE0021.severity = suggestion # IDE0021: Use expression body for constructor
dotnet_diagnostic.IDE0022.severity = suggestion # IDE0022: Use expression body for method
dotnet_diagnostic.IDE0055.severity = none # IDE0055: Fix formatting
dotnet_diagnostic.IDE0058.severity = none # IDE0058: Expression value is never used
dotnet_diagnostic.IDE0079.severity = warning # IDE0079: Remove unnecessary suppression
dotnet_diagnostic.IDE0290.severity = none # IDE0290: Use primary constructor

# AsyncFixer

@@ -438,10 +435,17 @@ dotnet_diagnostic.MA0018.severity = none # MA0018: Do not declare static members

# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
dotnet_diagnostic.CA1000.severity = none # CA1000: Do not declare static members on generic types
dotnet_diagnostic.CA1014.severity = none # CA1014: Mark assemblies with CLSCompliant
dotnet_diagnostic.CA1031.severity = suggestion # CA1031: Do not catch general exception types
dotnet_diagnostic.CA1032.severity = none # CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1052.severity = none # CA1052: Static holder types should be Static or NotInheritable
dotnet_diagnostic.CA1054.severity = none # CA1054: URI-like parameters should not be strings
dotnet_diagnostic.CA1055.severity = none # CA1055: Uri return values should not be strings
dotnet_diagnostic.CA1056.severity = none # CA1056: Uri properties should not be strings
dotnet_diagnostic.CA1812.severity = none # CA1812: Avoid uninstantiated internal classes
dotnet_diagnostic.CA2201.severity = suggestion # CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2227.severity = suggestion # CA2227: Collection properties should be read only

# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp
@@ -500,3 +504,4 @@ dotnet_diagnostic.S125.severity = none # S125: Sections of code should not be co
dotnet_diagnostic.S3459.severity = none # S3459: Unassigned members should be removed
dotnet_diagnostic.S3871.severity = none # S3871: Exception types should be "public"
dotnet_diagnostic.S1186.severity = none # S1186: Methods should not be empty
dotnet_diagnostic.S6608.severity = none # S6608: Indexing at Count-1 should be used instead of "Enumerable" extension method "Last"
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: linkdotnet
ko_fi: linkdotnet
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "monthly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "monthly"
20 changes: 12 additions & 8 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "CodeQL"
name: "CodeQL"

on:
schedule:
@@ -22,18 +22,22 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3.0.3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
include-prerelease: true
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
17 changes: 11 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -13,19 +13,24 @@ concurrency:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
dotnet-version: |
7.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
run: dotnet test -c Release --collect:"XPlat Code Coverage" --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
run: dotnet test -c Release --no-build -p:VSTestUseMSBuildOutput=false
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bin/
obj/
*.db
*.db-shm
*.db-wal
Publish/
/packages/
riderModule.iml
@@ -29,4 +31,4 @@ bundle.min.css
/CoverageReport/

# MacOS
.DS_Store
.DS_Store
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/LinkDotNet.Blog.Web/bin/Debug/net9.0/LinkDotNet.Blog.Web.dll",
"args": [],
"cwd": "${workspaceFolder}/src/LinkDotNet.Blog.Web",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
60 changes: 60 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup Label="Code Analyzers">
<PackageVersion Include="IDisposableAnalyzers" Version="4.0.8" />
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.10.0.116381" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers" />
</ItemGroup>
<ItemGroup Label="Infrastructure">
<PackageVersion Include="Azure.Storage.Blobs" Version="12.24.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="9.0.5" />
<PackageVersion Include="MongoDB.Driver" Version="3.4.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.3.efcore.9.0.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageVersion Include="RavenDB.Client" Version="7.0.2" />
</ItemGroup>
<ItemGroup Label="Web">
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
<PackageVersion Include="Blazored.Toast" Version="4.2.1" />
<PackageVersion Include="Blazorise.Bootstrap5" Version="1.7.6" />
<PackageVersion Include="Blazorise.Markdown" Version="1.7.6" />
<PackageVersion Include="Markdig" Version="0.41.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.5" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.5" />
<PackageVersion Include="NCronJob" Version="4.4.1" />
<PackageVersion Include="ReverseMarkdown" Version="4.6.0" />
<PackageVersion Include="System.ServiceModel.Syndication" Version="9.0.5" />
</ItemGroup>
<ItemGroup Label="Tests">
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="RavenDB.TestDriver" Version="7.0.2" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="bunit" Version="2.0.24-preview" />
<PackageVersion Include="bunit.generators" Version="2.0.24-preview" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<PackageVersion Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.msbuild" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="xunit.v3" Version="2.0.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.0" />
</ItemGroup>
<ItemGroup Label="Tools">
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="Microsoft.Playwright" Version="1.52.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src/LinkDotNet.Blog.Web
COPY ./ /
RUN dotnet restore "LinkDotNet.Blog.Web.csproj"
Loading