Skip to content

Instantly share code, notes, and snippets.

View AlexanderReaper7's full-sized avatar
🤖

Alexander Öberg AlexanderReaper7

🤖
  • Sweden
  • 19:42 (UTC +01:00)
View GitHub Profile
@AlexanderReaper7
AlexanderReaper7 / _schema.json
Created November 27, 2024 19:11
wfdata schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
@AlexanderReaper7
AlexanderReaper7 / MediatRLogger.cs
Last active May 30, 2024 17:10
C# ASP.NET MediatR logger and validator for ErrorOr requests
using ErrorOr;
using global::MediatR;
/// <summary>
/// A logging behavior for MediatR. Logs the request and any exceptions that occur.
/// </summary>
public class MediatRLoggerIErrorOr<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
where TRequest : notnull
where TResponse : IErrorOr
{