-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-solution.bat
53 lines (36 loc) · 1.33 KB
/
generate-solution.bat
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
cls
REM Create projects
dotnet new classlib -o Model
dotnet new classlib -o Context
dotnet new classlib -o MigrationForSqlite
dotnet new webapi -o Api
REM Model
del Model\Class1.cs
copy templates\Model.User.cs Model\User.cs
REM Context
del Context\Class1.cs
copy templates\Context.AppDbContext.cs Context\AppDbContext.cs
dotnet add Context reference Model
dotnet add Context package Microsoft.EntityFrameworkCore
REM MigrationForSqlite
del MigrationForSqlite\Class1.cs
copy templates\MigrationForSqlite.Empty.cs MigrationForSqlite\Empty.cs
dotnet add MigrationForSqlite reference Context
dotnet add MigrationForSqlite package Microsoft.EntityFrameworkCore.Sqlite
REM Api
del Api\Program.cs
copy templates\Api.Program.cs Api\Program.cs
dotnet add Api reference MigrationForSqlite
dotnet add Api package Microsoft.EntityFrameworkCore.Tools
dotnet add Api package Microsoft.VisualStudio.Web.CodeGeneration.Design
REM remove InvariantGlobalization
findstr /C:"<InvariantGlobalization>true</InvariantGlobalization>" Api\Api.csproj
type Api\Api.csproj | findstr /v /C:"<InvariantGlobalization>true</InvariantGlobalization>" > temp.csproj
move /y temp.csproj Api\Api.csproj
del temp.csproj
REM Create a solution and add projects
dotnet new sln -n Test
dotnet sln add Api
dotnet sln add Model
dotnet sln add Context
dotnet sln add MigrationForSqlite