Skip to content

Commit

Permalink
简化字段缓存的代码生成
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Dec 25, 2024
1 parent 847cfa2 commit 8a26e99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions XCode/Code/EntityBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ protected virtual void BuildSearch()

WriteLine();
WriteLine($"// Select Count({pname}) as {pname},{name} From {Table.TableName} Where {tname}>'2020-01-24 00:00:00' Group By {name} Order By {pname} Desc limit 20");
WriteLine($"static readonly FieldCache<{returnName}> _{name}Cache = new FieldCache<{returnName}>(nameof({name}))");
WriteLine($"static readonly FieldCache<{returnName}> _{name}Cache = new(nameof({name}))");
WriteLine("{");
{
WriteLine($"//Where = _.{tname} > DateTime.Today.AddDays(-30) & Expression.Empty");
Expand All @@ -1911,7 +1911,7 @@ protected virtual void BuildSearch()
{
WriteLine();
WriteLine($"// Select Count({pname}) as {pname},Category From {Table.TableName} Where {tname}>'2020-01-24 00:00:00' Group By Category Order By {pname} Desc limit 20");
WriteLine($"//static readonly FieldCache<{returnName}> _CategoryCache = new FieldCache<{returnName}>(nameof(Category))");
WriteLine($"//static readonly FieldCache<{returnName}> _CategoryCache = new(nameof(Category))");
WriteLine("//{");
{
WriteLine($"//Where = _.{tname} > DateTime.Today.AddDays(-30) & Expression.Empty");
Expand Down

0 comments on commit 8a26e99

Please sign in to comment.