Last active
January 3, 2024 07:11
-
-
Save somapatrik/a647dfd3bc1bc799bda7a9ee0404dc22 to your computer and use it in GitHub Desktop.
Command + Handler snippet
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Command with handler</Title> | |
<Author>Patrik Šoma</Author> | |
<Description>SLM Only!</Description> | |
<Shortcut>cmdhnd</Shortcut> | |
</Header> | |
<Snippet> | |
<Code Language="CSharp"> | |
<![CDATA[ | |
public class $cmdName$Command : CommandBase | |
{ | |
public $cmdName$Command() { } | |
} | |
internal class $cmdName$CommandHandler : ICommandHandler<$cmdName$Command> | |
{ | |
public Task<Unit> Handle($cmdName$Command request, CancellationToken cancellationToken) | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
]]> | |
</Code> | |
<Declarations> | |
<Literal> | |
<ID>cmdName</ID> | |
<ToolTip>Command name</ToolTip> | |
<Default>MyCmdName</Default> | |
</Literal> | |
</Declarations> | |
<Imports> | |
<Import> | |
<Namespace> | |
PQS.SLM.BuildingBlocks.Application.Configuration.Commands; | |
</Namespace> | |
</Import> | |
<Import> | |
<Namespace> | |
PQS.SLM.BuildingBlocks.Application.Configuration.Contracts; | |
</Namespace> | |
</Import> | |
</Imports> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good