-
Notifications
You must be signed in to change notification settings - Fork 0
/
implContract.snippet
73 lines (59 loc) · 2.11 KB
/
implContract.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
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ImplContract</Title>
<Author>Addy</Author>
<Description>Creates an service implementation template for the wcf contract</Description>
<Shortcut>implContract</Shortcut>
</Header>
<Snippet>
<Imports>
</Imports>
<Declarations>
<Literal>
<ID>PocoName</ID>
<ToolTip></ToolTip>
<Default>PocoName</Default>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[
#region $PocoName$
public void Add$PocoName$($PocoName$Poco[] pocos)
{
var repository = new EFGenericRepository<$PocoName$Poco>(createProxy: false);
$PocoName$Logic bl = new $PocoName$Logic(repository);
bl.Add(pocos);
}
public List<$PocoName$Poco> GetAll$PocoName$()
{
var repository = new EFGenericRepository<$PocoName$Poco>(createProxy: false);
$PocoName$Logic bl = new $PocoName$Logic(repository);
return bl.GetAll();
}
public $PocoName$Poco GetSingle$PocoName$(string id)
{
var repository = new EFGenericRepository<$PocoName$Poco>(createProxy: false);
$PocoName$Logic bl = new $PocoName$Logic(repository);
return bl.Get(Guid.Parse(id));
}
public void Remove$PocoName$($PocoName$Poco[] pocos)
{
var repository = new EFGenericRepository<$PocoName$Poco>(createProxy: false);
$PocoName$Logic bl = new $PocoName$Logic(repository);
bl.Delete(pocos);
}
public void Update$PocoName$($PocoName$Poco[] pocos)
{
var repository = new EFGenericRepository<$PocoName$Poco>(createProxy: false);
$PocoName$Logic bl = new $PocoName$Logic(repository);
bl.Update(pocos);
}
#endregion
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>