-
Notifications
You must be signed in to change notification settings - Fork 3
/
srk.domain.snippet
60 lines (53 loc) · 1.46 KB
/
srk.domain.snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Author>SandRock</Author>
<Title>rrr Create the base types for a request/result pattern</Title>
<Shortcut>rrr</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>Name</ID>
<Default>EditStuff</Default>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[using SrkToolkit.Domain;
using System.Runtime.Serialization;
[DataContract]
public class $Name$Request : BaseRequest
{
public $Name$Request()
{
}
public ILocalResult Execute(IDomainOperationContext context)
{
var result = new $Name$Result(null);
return result.Execute(context, this);
}
}
[DataContract]
public class $Name$Result : BaseResult<$Name$Request, $Name$Error>
{
public $Name$Result($Name$Request request)
: base(request)
{
}
internal $Name$Result Execute($Name$Request request)
{
// TODO: implement me
return (this);
}
}
[DataContract]
public enum $Name$Error
{
Invalid,
NotAuthorized,
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>