Skip to content

Commit 79eb390

Browse files
committed
add RazorTemplates/Proj-Repository.cshtml
fixed DbSource.LanguageType
1 parent 8d513e6 commit 79eb390

File tree

6 files changed

+72
-13
lines changed

6 files changed

+72
-13
lines changed

doc/SmartCode.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ Build:
2525
Path: '.'
2626
Name: '{{Project.Module}}'
2727
Extension: '.sln'
28-
Service:
29-
Type: Project
30-
Template: Proj.cshtml
31-
Output:
32-
Path: '{{Project.Module}}.Serivce'
33-
Name: '{{Project.Module}}.Serivce'
34-
Extension: '.csproj'
3528
SmartSqlConfig:
3629
Type: Project
3730
Template: SqlMapConfig.cshtml
3831
Output:
3932
Path: '{{Project.Module}}.API'
4033
Name: 'SmartSqlMapConfig'
4134
Extension: '.xml'
35+
Entity_Project:
36+
Type: Project
37+
Template: Proj.cshtml
38+
Output:
39+
Path: '{{Project.Module}}.Entity'
40+
Name: '{{Project.Module}}.Entity'
41+
Extension: '.csproj'
4242
Entity:
4343
Type: Table
4444
Module: Entity
@@ -71,7 +71,13 @@ Build:
7171
Delimiter: '_'
7272
Converter:
7373
Type: Pascal
74-
74+
Repository_Project:
75+
Type: Project
76+
Template: Proj-Repository.cshtml
77+
Output:
78+
Path: '{{Project.Module}}.Repository'
79+
Name: '{{Project.Module}}.Repository'
80+
Extension: '.csproj'
7581
Repository:
7682
Type: Table
7783
Module: Repository
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@using RazorLight
2+
@using SmartCode
3+
@inherits TemplatePage<BuildContext>
4+
@{
5+
DisableEncoding = true;
6+
var project = Model.Project;
7+
}
8+
9+
<Project Sdk="Microsoft.NET.Sdk">
10+
<PropertyGroup>
11+
<TargetFramework>netstandard2.0</TargetFramework>
12+
</PropertyGroup>
13+
<ItemGroup>
14+
<PackageReference Include="SmartSql" Version="3.7.8" />
15+
<PackageReference Include="SmartSql.DyRepository" Version="3.6.1" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ProjectReference Include="..\@(project.Module).Entity\@(project.Module).Entity.csproj" />
19+
</ItemGroup>
20+
</Project>
21+

src/SmartCode.CLI/RazorTemplates/Proj.cshtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@
66
var project = Model.Project;
77
}
88

9+
<Project Sdk="Microsoft.NET.Sdk">
10+
<PropertyGroup>
11+
<TargetFramework>netstandard2.0</TargetFramework>
12+
</PropertyGroup>
13+
</Project>

src/SmartCode.CLI/RazorTemplates/Sln.cshtml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,29 @@
66
var project = Model.Project;
77
}
88

9-
@Model.Build
9+
10+
Microsoft Visual Studio Solution File, Format Version 12.00
11+
# Visual Studio 15
12+
VisualStudioVersion = 15.0.27428.2037
13+
MinimumVisualStudioVersion = 10.0.40219.1
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "@(project.Module).Entity", "@(project.Module).Entity\@(project.Module).Entity.csproj", "{88A185DB-0242-4843-9284-334850FF611C}"
15+
EndProject
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "@(project.Module).Repository", "@(project.Module).Repository\@(project.Module).Repository.csproj", "{6A7E8C9E-6A9F-49FD-AD48-F297E515EB10}"
17+
EndProject
18+
19+
Global
20+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
21+
Debug|Any CPU = Debug|Any CPU
22+
Release|Any CPU = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25+
{88A185DB-0242-4843-9284-334850FF611C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{88A185DB-0242-4843-9284-334850FF611C}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{88A185DB-0242-4843-9284-334850FF611C}.Release|Any CPU.ActiveCfg = Release|Any CPU
28+
{88A185DB-0242-4843-9284-334850FF611C}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{6A7E8C9E-6A9F-49FD-AD48-F297E515EB10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{6A7E8C9E-6A9F-49FD-AD48-F297E515EB10}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{6A7E8C9E-6A9F-49FD-AD48-F297E515EB10}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{6A7E8C9E-6A9F-49FD-AD48-F297E515EB10}.Release|Any CPU.Build.0 = Release|Any CPU
33+
EndGlobalSection
34+
EndGlobal

src/SmartCode.CLI/SmartCode.CLI.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
<PreserveCompilationContext>true</PreserveCompilationContext>
66
<LangVersion>latest</LangVersion>
77
<ApplicationIcon />
8-
<OutputType>WinExe</OutputType>
98
<StartupObject />
10-
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
9+
<OutputType>Exe</OutputType>
1110
</PropertyGroup>
1211

1312
<ItemGroup>
@@ -35,6 +34,9 @@
3534
<None Update="RazorTemplates\Copyright.cshtml">
3635
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3736
</None>
37+
<None Update="RazorTemplates\Proj-Repository.cshtml">
38+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
39+
</None>
3840
<None Update="RazorTemplates\Proj.cshtml">
3941
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4042
</None>

src/SmartCode.Db/DbSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public IEnumerable<Table> Tables
4343
DbRepository = new DbRepository(_project, _loggerFactory);
4444
_tables = DbRepository.QueryTable();
4545
var dbTypeConvert = _pluginManager.Resolve<IDbTypeConverter>();
46-
foreach (var table in Tables)
46+
foreach (var table in _tables)
4747
{
4848
foreach (var col in table.Columns)
4949
{
50-
dbTypeConvert.LanguageType(DbRepository.DbProvider, _project.Language, col.DbType);
50+
col.LanguageType = dbTypeConvert.LanguageType(DbRepository.DbProvider, _project.Language, col.DbType);
5151
}
5252
}
5353
}

0 commit comments

Comments
 (0)