Created
November 6, 2024 11:48
-
-
Save flew2bits/21dc9347523d596a1398e4195a075e28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public record MyCommand([property: Identity] Guid Id, string SomeValue); | |
[AttributeUsage(AttributeTargets.Method)] | |
public class MyAttribute: Attribute { | |
public MyAttribute(string something) => Something = something; | |
public string Something {get;} | |
} | |
public static class MyCommandHandler { | |
[AggregateHandler] | |
[MyAttribute("Some Value")] | |
public static Events Handle(MyCommand cmd) { | |
// do work | |
return []; | |
} | |
} | |
public static class MyMiddleware { | |
public void Before(MyCommand command, MyAttribute attribute) { | |
// do something with the value in the attribute | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment