Skip to content

Commit 90a8f92

Browse files
remove unnecessary 'ToList()'-calls that serve no purpose
1 parent d20e930 commit 90a8f92

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

SqlKata.Execution/QueryFactory.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,7 @@ private static IEnumerable<T> handleIncludes<T>(Query query, IEnumerable<T> resu
671671

672672
var dynamicResult = result
673673
.Cast<IDictionary<string, object>>()
674-
.Select(x => new Dictionary<string, object>(x, StringComparer.OrdinalIgnoreCase))
675-
.ToList();
674+
.Select(x => new Dictionary<string, object>(x, StringComparer.OrdinalIgnoreCase));
676675

677676
foreach (var include in query.Includes)
678677
{
@@ -697,9 +696,7 @@ private static IEnumerable<T> handleIncludes<T>(Query query, IEnumerable<T> resu
697696
include.ForeignKey = table.Singularize(false) + "Id";
698697
}
699698

700-
var localIds = dynamicResult.Where(x => x[include.LocalKey] != null)
701-
.Select(x => x[include.LocalKey].ToString())
702-
.ToList();
699+
var localIds = dynamicResult.Where( x => x[include.LocalKey] != null ).Select( x => x[include.LocalKey].ToString() );
703700

704701
if (!localIds.Any())
705702
{

0 commit comments

Comments
 (0)