File tree Expand file tree Collapse file tree 6 files changed +38
-4
lines changed Expand file tree Collapse file tree 6 files changed +38
-4
lines changed Original file line number Diff line number Diff line change 19
19
</Declarations>
20
20
<Code Language="csharp"><![CDATA[public class $DbContextClassName$DbContext : DbContext
21
21
{
22
- public ${1:DbContextDbContext} DbContext(DbContextOptions options) : base(options)
22
+ public $DbContextClassName$ DbContext(DbContextOptions options) : base(options)
23
23
{
24
24
}
25
25
26
26
$end$
27
27
}]]></Code>
28
+ <Imports>
29
+ <Import>
30
+ <Namespace>Microsoft.EntityFrameworkCore</Namespace>
31
+ </Import>
32
+ </Imports>
28
33
</Snippet>
29
34
</CodeSnippet>
30
35
</CodeSnippets>
Original file line number Diff line number Diff line change 43
43
var builder = new ConfigurationBuilder()
44
44
.SetBasePath(basePath)
45
45
.AddJsonFile("appsettings.json")
46
- .AddJsonFile($"appsettings.{environmentName}.json", true)
46
+ .AddJsonFile($$ "appsettings.{environmentName}.json", true)
47
47
.AddEnvironmentVariables();
48
48
49
49
var config = builder.Build();
65
65
{
66
66
if (string.IsNullOrEmpty(connectionString))
67
67
throw new ArgumentException(
68
- $"{nameof(connectionString)} is null or empty.",
68
+ $$ "{nameof(connectionString)} is null or empty.",
69
69
nameof(connectionString));
70
70
71
71
var optionsBuilder =
80
80
return new $DbContextClassName$DbContext(optionsBuilder.Options);
81
81
}
82
82
}]]></Code>
83
+ <Imports>
84
+ <Import>
85
+ <Namespace>System.IO</Namespace>
86
+ </Import>
87
+ <Import>
88
+ <Namespace>Microsoft.EntityFrameworkCore</Namespace>
89
+ </Import>
90
+ <Import>
91
+ <Namespace>Microsoft.EntityFrameworkCore.Design</Namespace>
92
+ </Import>
93
+ <Import>
94
+ <Namespace>Microsoft.Extensions.Configuration</Namespace>
95
+ </Import>
96
+ </Imports>
83
97
</Snippet>
84
98
</CodeSnippet>
85
99
</CodeSnippets>
Original file line number Diff line number Diff line change 18
18
</Literal>
19
19
</Declarations>
20
20
<Code Language="csharp"><![CDATA[public DbSet<$MappedClassName$> $MappedClassName$s { get; set; }$end$]]></Code>
21
+ <Imports>
22
+ <Import>
23
+ <Namespace>Microsoft.EntityFrameworkCore</Namespace>
24
+ </Import>
25
+ </Imports>
21
26
</Snippet>
22
27
</CodeSnippet>
23
28
</CodeSnippets>
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ public class $TestClassName$Fixture
26
26
27
27
$end$
28
28
}]]></Code>
29
+ <Imports>
30
+ <Import>
31
+ <Namespace>Microsoft.VisualStudio.TestTools.UnitTesting</Namespace>
32
+ </Import>
33
+ </Imports>
29
34
</Snippet>
30
35
</CodeSnippet>
31
36
</CodeSnippets>
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ public class $TestClassName$Fixture
43
43
44
44
$end$
45
45
}]]></Code>
46
+ <Imports>
47
+ <Import>
48
+ <Namespace>Microsoft.VisualStudio.TestTools.UnitTesting</Namespace>
49
+ </Import>
50
+ </Imports>
46
51
</Snippet>
47
52
</CodeSnippet>
48
53
</CodeSnippets>
Original file line number Diff line number Diff line change 27
27
"body" : [
28
28
" public class ${1:DbContextClassName}DbContext : DbContext" ,
29
29
" {" ,
30
- " public ${1:DbContextDbContext }DbContext(DbContextOptions options) : base(options)" ,
30
+ " public ${1:DbContextClassName }DbContext(DbContextOptions options) : base(options)" ,
31
31
" {" ,
32
32
" }" ,
33
33
" " ,
You can’t perform that action at this time.
0 commit comments