Last active
January 3, 2024 07:11
-
-
Save somapatrik/9b149241a1010005fe49d9bb5c83c739 to your computer and use it in GitHub Desktop.
Query + Handler
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>Query with handler</Title> | |
<Author>Patrik Šoma</Author> | |
<Description>SLM only!</Description> | |
<Shortcut>qryhnd</Shortcut> | |
</Header> | |
<Snippet> | |
<Code Language="CSharp"> | |
<![CDATA[ | |
public class $QueryName$Query : IQuery<$ReturnName$> | |
{ | |
public $QueryName$Query() { } | |
} | |
internal class $QueryName$QueryHandler : IQueryHandler<$QueryName$Query, $ReturnName$> | |
{ | |
public Task<$ReturnName$> Handle($QueryName$Query request, CancellationToken cancellationToken) | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
]]> | |
</Code> | |
<Declarations> | |
<Literal> | |
<ID>QueryName</ID> | |
<ToolTip>Query name</ToolTip> | |
<Default>MyQueryName</Default> | |
</Literal> | |
<Literal> | |
<ID>ReturnName</ID> | |
<ToolTip>Return object</ToolTip> | |
<Default>ReturnObjectName</Default> | |
</Literal> | |
</Declarations> | |
<Imports> | |
<Import> | |
<Namespace>PQS.SLM.BuildingBlocks.Application.Configuration.Queries;</Namespace> | |
</Import> | |
<Import> | |
<Namespace>PQS.SLM.BuildingBlocks.Application.Configuration.Contracts;</Namespace> | |
</Import> | |
<Import> | |
<Namespace>System.Threading;</Namespace> | |
</Import> | |
</Imports> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment