File tree Expand file tree Collapse file tree 4 files changed +9
-24
lines changed
SmartCode.CLI/OfficialRazorTemplates Expand file tree Collapse file tree 4 files changed +9
-24
lines changed Original file line number Diff line number Diff line change 4747 }
4848 }
4949 );
50- @if (autoIncrement )
51- {
52- <text >Select Scope_Identity ();</text >
53- }
5450 </Statement >
5551
5652 <!-- 删除-->
5955 Where @pkCol.Name =@pkCol.ConvertedName
6056 </Statement >
6157
62-
6358 <!-- 更新-->
6459 <Statement Id =" Update" >
6560 UPDATE @table.Name
Original file line number Diff line number Diff line change 3636 var col = table .Columns .ElementAt (i );
3737 @if (! col .AutoIncrement )
3838 {
39- @col.Name @( i == table .Columns .Count () - 1 ? " \r\n " : " \r\n " + this . PadLeft ( 6 ) + " ," )
39+ @col.Name @( i == table .Columns .Count () - 1 ? Html . NewLine () : Html . NewLine ( " ," ) )
4040 }
4141 }
4242 )
4747 var col = table .Columns .ElementAt (i );
4848 @if (! col .AutoIncrement )
4949 {
50- @[email protected] @( i == table .
Columns .
Count ()
- 1 ? " \r\n " : " \r\n " + this . PadLeft ( 6 ) + " ," ) 50+ @[email protected] @( i == table .
Columns .
Count ()
- 1 ? Html . NewLine () : Html . NewLine ( " ," ) ) 5151 }
5252 }
5353 );
7777 </Statement >
7878
7979 <!-- 获取数据列-->
80- <Statement Id =" Query" @queryStatementResultMap = queryStatementResultMap >
80+ <Statement Id =" Query" @queryStatementResultMap >
8181 SELECT T.* From @table.Name T
8282 <Include RefId =" QueryParams" />
8383 Order By T.@pkCol.Name Desc
8484 </Statement >
8585
8686 <!-- 获取分页数据-->
87- <Statement Id =" QueryByPage" @queryStatementResultMap = queryStatementResultMap >
87+ <Statement Id =" QueryByPage" @queryStatementResultMap >
8888 Select T.* From @table.Name As T
8989 <Include RefId =" QueryParams" />
9090 <Switch Prepend =" Order By" Property =" OrderBy" >
102102 </Statement >
103103
104104 <!-- 获取表映射实体-->
105- <Statement Id =" GetEntity" @queryStatementResultMap = queryStatementResultMap >
105+ <Statement Id =" GetEntity" @queryStatementResultMap >
106106 Select Top 1 T.* From @table.Name T
107107 <Where >
108108 <IsNotEmpty Prepend =" And" Property =" @pkCol.ConvertedName" >
Original file line number Diff line number Diff line change @@ -68,20 +68,6 @@ private IServiceCollection ConfigureDefaultServices()
6868 ApplicationName = Assembly . GetEntryAssembly ( ) . GetName ( ) . Name ,
6969 WebRootFileProvider = fileProvider ,
7070 } ) ;
71- //services.Configure<WebEncoderOptions>(options =>
72- // {
73- // var txtEncoderSettings = new TextEncoderSettings(UnicodeRanges.All);
74- // //txtEncoderSettings.Clear();
75- // txtEncoderSettings.AllowCharacter('<');
76- // txtEncoderSettings.AllowCharacter('>');
77- // txtEncoderSettings.AllowCharacter('&');
78- // txtEncoderSettings.AllowCharacter('\''); // can be used to escape attributes
79- // txtEncoderSettings.AllowCharacter('\"'); // can be used to escape attributes
80- // txtEncoderSettings.AllowCharacter('+');
81- // options.TextEncoderSettings = txtEncoderSettings;
82- // }
83- // );
84-
8571 services . Configure < RazorViewEngineOptions > ( options =>
8672 {
8773 options . FileProviders . Clear ( ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ public static IHtmlContent NewLine(this IHtmlHelper htmlHelper)
1212 {
1313 return htmlHelper . Raw ( Environment . NewLine ) ;
1414 }
15+ public static IHtmlContent NewLine ( this IHtmlHelper htmlHelper , string appendStr )
16+ {
17+ return htmlHelper . Raw ( Environment . NewLine + appendStr ) ;
18+ }
1519
1620 public static IHtmlContent PadLeft ( this IHtmlHelper htmlHelper , int totalWidth )
1721 {
You can’t perform that action at this time.
0 commit comments