-
Notifications
You must be signed in to change notification settings - Fork 16
/
ef-core-snippets.snippet
54 lines (52 loc) · 1.44 KB
/
ef-core-snippets.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
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Add EF Core migration</Title>
<Author>Chris Klug</Author>
<Shortcut>efmigration</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[[Migration("$SequenceNr$_$MigrationName$")]
[DbContext(typeof($DbContext$))]
public class $MigrationName$ : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
$end$
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
]]>
</Code>
<Declarations>
<Literal>
<ID>SequenceNr</ID>
<ToolTip>The sequence number to use for the migration</ToolTip>
<Default>XXXXXXX</Default>
</Literal>
<Literal>
<ID>MigrationName</ID>
<ToolTip>The name of the migration</ToolTip>
<Default>MyMigration</Default>
</Literal>
<Literal>
<ID>DbContext</ID>
<ToolTip>The DbContext to "attach" the migration to</ToolTip>
<Default>MyDbContext</Default>
</Literal>
</Declarations>
<Imports>
<Import>
<Namespace>Microsoft.EntityFrameworkCore.Infrastructure</Namespace>
</Import>
<Import>
<Namespace>Microsoft.EntityFrameworkCore.Migrations</Namespace>
</Import>
</Imports>
</Snippet>
</CodeSnippet>
</CodeSnippets>