Skip to content

Instantly share code, notes, and snippets.

View 304NotModified's full-sized avatar

Julian Verdurmen 304NotModified

  • Utrecht, Netherlands
View GitHub Profile
@MelbourneDeveloper
MelbourneDeveloper / LogCheckExtensions.cs
Last active April 28, 2021 11:50
ILogger Verification with Moq
using Microsoft.Extensions.Logging;
using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
// More detailed samples here:
// https://github.com/MelbourneDeveloper/RestClient.Net/blob/79cca66e02f83a1043c44f215d374139f40f8c12/src/RestClient.Net.UnitTests/UnitTests.cs#L758
@davidfowl
davidfowl / .NET6Migration.md
Last active October 23, 2024 18:30
.NET 6 ASP.NET Core Migration
@axelheer
axelheer / ConvertTo-CentralPackageManagement.ps1
Last active September 4, 2024 08:21
Generates a `Directory.Packages.props` based on all your project files
function ConvertTo-CentralPackageManagement() {
Write-Host 'Searching for package references'
$packages = @{}
$conditionalPackages = @{}
foreach ($csproj in (Get-ChildItem -Include *.csproj, *.props -Recurse)) {
$root = [xml]($csproj | Get-Content -Raw)
foreach ($itemGroup in $root.Project.ItemGroup) {
foreach ($packageReference in $itemGroup.PackageReference) {
if ($packageReference.Include -and $packageReference.Version) {