Skip to content

Commit 85ccee7

Browse files
author
zzzprojects
committed
Update source
Update source
1 parent 3d54519 commit 85ccee7

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

src/shared/Z.EF.Plus.BatchUpdate.Shared/BatchUpdate.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,10 @@ public DbCommand CreateCommand(IQueryable query, IEntityType entity, List<Tuple<
889889
else
890890
{
891891
parameter.Value = paramValue ?? DBNull.Value;
892+
if (isSqlServer && parameter.Value is DateTime)
893+
{
894+
parameter.DbType = DbType.DateTime2;
895+
}
892896
}
893897

894898
command.Parameters.Add(parameter);

src/shared/Z.EF.Plus.QueryFilter.Shared/QueryFilterManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ static QueryFilterManager()
5656
CacheWeakFilterQueryable = new ConditionalWeakTable<IQueryable, AliasBaseQueryFilterQueryable>();
5757
GlobalFilters = new Dictionary<object, AliasBaseQueryFilter>();
5858
GlobalInitializeFilterActions = new List<Tuple<AliasBaseQueryFilter, Action<AliasBaseQueryFilter>>>();
59+
60+
#if NETSTANDARD2_0
61+
ForceCast = true;
62+
#endif
5963
}
6064

6165
#if EFCORE

src/shared/Z.EF.Plus.QueryFilter.Shared/QueryFilterSet.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public AliasBaseQueryFilterQueryable AddOrGetFilterQueryable(DbContext context)
113113

114114
if (context.IsEFCore2x())
115115
{
116-
var type = set.GetType();
117116
var field = set.GetType().GetProperty("EntityQueryable", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
118117
var internalQuery = field.GetValue(set);
119118

src/shared/Z.EF.Plus.QueryIncludeFilter.Shared/QueryIncludeFilterParentQueryable`.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Linq;
1212
using System.Linq.Expressions;
1313
using System.Threading.Tasks;
14-
#if NET45
14+
#if NET45 && !NETSTANDARD2_0
1515
using System.Data.Entity.Infrastructure;
1616

1717
#endif

src/shared/Z.EF.Plus.QueryIncludeFilter.Shared/QueryIncludeFilterProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Reflection;
1212
using System.Threading;
1313
using System.Threading.Tasks;
14-
#if NET45
14+
#if NET45 && !NETSTANDARD2_0
1515
using System.Data.Entity.Infrastructure;
1616

1717
#endif

src/shared/Z.EF.Plus._Core.Shared/EFCore/DbContext/DbContext.IsEFCore2x.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ public static bool IsEFCore2x(this DbContext context)
2222
#else
2323
return false;
2424
#endif
25-
//var assembly = context.Database.GetType().Assembly;
26-
//var version = assembly.GetName().Version;
27-
//return version.Major >= 2;
2825
}
2926
}
3027
}

0 commit comments

Comments
 (0)