1. DAL 层的 LoadAllForeignKeyColumn 中
if (string.IsNullOrEmpty(loadOptions) || items == null || items.Count() == 0)
{
return;
}
应该改为:
if (string.IsNullOrEmpty(loadOptions) || items == null || !items.Any())
{
return;
}
2. 去掉 GetEntityBySql 中的 // CodeSmith 注释:如果该表有外键则有如下代码
本文针对DAL层的LoadAllForeignKeyColumn方法提出了优化建议,将原本的Count()方法替换为Any()方法以提高效率,并去除了GetEntityBySql方法中的冗余注释。
1万+

被折叠的 条评论
为什么被折叠?



