Skip to content

Commit e188f0b

Browse files
Add latest version
Add latest version
1 parent 965e03f commit e188f0b

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit)
2+
//// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus
3+
//// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues
4+
//// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE
5+
//// More projects: http://www.zzzprojects.com/
6+
//// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved.
7+
8+
//using System;
9+
//using System.Collections.Generic;
10+
//using System.Linq;
11+
//using System.Linq.Expressions;
12+
//using Microsoft.EntityFrameworkCore.Query;
13+
14+
//namespace Z.EntityFramework.Plus
15+
//{
16+
// public static partial class QueryIncludeFilterExtensions
17+
// {
18+
// /// <summary>
19+
// /// An IQueryable&lt;T&gt; extension method that include and filter related entities.
20+
// /// </summary>
21+
// /// <typeparam name="T">Generic type parameter.</typeparam>
22+
// /// <typeparam name="TChild">Type of the child.</typeparam>
23+
// /// <param name="query">The query to filter included related entities.</param>
24+
// /// <param name="queryIncludeFilter">The query filter to apply on included related entities.</param>
25+
// /// <returns>An IQueryable&lt;T&gt; that include and filter related entities.</returns>
26+
// public static IQueryable<T> ThenIncludeFilter<TEntity, TPreviousProperty, TChild>(this IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>> source, Expression<Func<TPreviousProperty, IEnumerable<TChild>>> queryIncludeFilter) where TPreviousProperty : class where TChild : class
27+
// {
28+
// return query.IncludeOptimizedSingle(queryIncludeFilter);
29+
// }
30+
31+
// /// <summary>
32+
// /// An IQueryable&lt;T&gt; extension method that include and filter related entities.
33+
// /// </summary>
34+
// /// <typeparam name="T">Generic type parameter.</typeparam>
35+
// /// <typeparam name="TChild">Type of the child.</typeparam>
36+
// /// <param name="query">The query to filter included related entities.</param>
37+
// /// <param name="queryIncludeFilter">The query filter to apply on included related entities.</param>
38+
// /// <returns>An IQueryable&lt;T&gt; that include and filter related entities.</returns>
39+
// public static IQueryable<T> ThenIncludeFilter<TEntity, TPreviousProperty, TChild>(this IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>> source, Expression<Func<TPreviousProperty, TChild>> queryIncludeFilter) where TPreviousProperty : class where TChild : class
40+
// {
41+
// return query.IncludeOptimizedSingle(queryIncludeFilter);
42+
// }
43+
// }
44+
//}

src/shared/Z.EF.Plus.QueryIncludeFilterCore.Shared/QueryIncludeFilterNullCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static void CheckNullRecursive(object currentItem, List<string> paths, in
8888

8989
private static void CheckAndSetCollection(PropertyOrFieldAccessor accessor, object currentItem, Type propertyType, Type originalType)
9090
{
91-
if (propertyType.GetGenericArguments().Length == 1)
91+
if (propertyType.GetGenericArguments().Length == 1 && typeof(IEnumerable).IsAssignableFrom(propertyType))
9292
{
9393
object value;
9494

src/shared/Z.EF.Plus.QueryIncludeFilterCore.Shared/Z.EF.Plus.QueryIncludeFilterCore.Shared.projitems

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
</PropertyGroup>
1818
<ItemGroup>
1919
<Compile Include="$(MSBuildThisFileDirectory)BaseQueryIncludeFilterChild.cs" />
20+
<Compile Include="$(MSBuildThisFileDirectory)Extensions\IQueryable`.ThenIncludeFilter.cs" />
2021
<Compile Include="$(MSBuildThisFileDirectory)Extensions\IQueryable`.IncludeFilterByPath.cs" />
2122
<Compile Include="$(MSBuildThisFileDirectory)Extensions\IQueryable`.IncludeFilter.cs" />
2223
<Compile Include="$(MSBuildThisFileDirectory)QueryIncludeFilterByPath.cs" />

src/shared/Z.EF.Plus.QueryIncludeOptimized.Shared/QueryIncludeOptimizedNullCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public static void CheckNullRecursive(object currentItem, List<string> paths, in
8888

8989
private static void CheckAndSetCollection(PropertyOrFieldAccessor accessor, object currentItem, Type propertyType, Type originalType)
9090
{
91-
if (propertyType.GetGenericArguments().Length == 1)
92-
{
91+
if (propertyType.GetGenericArguments().Length == 1 && typeof(IEnumerable).IsAssignableFrom(propertyType))
92+
{
9393
object value;
9494

9595
var genericTypeDefinition = propertyType.GetGenericTypeDefinition();

0 commit comments

Comments
 (0)