Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>

<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net6.0</NhAppTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0</NhLibTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0;netstandard2.1</NhLibTargetFrameworks>
<NhNetFx>false</NhNetFx>
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
<!-- Visual Basic requires to use coma (,) as a separator, other project types - semicolon (;) -->
Expand Down
2 changes: 1 addition & 1 deletion default.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<arg value="/t:Restore" />
<arg value="/t:Rebuild" />
<arg value="/v:q" />
<arg value="/m" />
<arg value="/m:1" />
</exec>
</target>

Expand Down
1 change: 1 addition & 0 deletions psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Task Build {
Exec {
dotnet `
build ./src/NHibernate.sln `
-m:1 `
-c Release
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate/Collection/Generic/SetHelpers/SetSnapShot.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
using System.Runtime.Serialization;
using System.Threading;
#endif
Expand Down Expand Up @@ -132,7 +132,7 @@ void ICollection.CopyTo(Array array, int index)
}
#endif

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
[Serializable]
internal class SetSnapShot<T> : HashSet<T>, ICollection
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Driver/DriverBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public DbParameter GenerateOutputParameter(DbCommand command)

public virtual bool RequiresTimeSpanForTime => false;

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
public virtual bool SupportsSystemTransactions => false;

public virtual bool SupportsNullEnlistment => false;
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate/Driver/ReflectionBasedDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ protected ReflectionBasedDriver(string providerInvariantName, string driverAssem

if (connectionType == null || commandType == null)
{
#if NETFX
#if NETFX || NETSTANDARD2_1_OR_GREATER
if (string.IsNullOrEmpty(providerInvariantName))
{
#endif
throw new HibernateException(string.Format(ReflectionTypedProviderExceptionMessageTemplate, driverAssemblyName));
#if NETFX
#if NETFX || NETSTANDARD2_1_OR_GREATER
}
var factory = DbProviderFactories.GetFactory(providerInvariantName);
connectionCommandProvider = new DbProviderFactoryDriveConnectionCommandProvider(factory);
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Linq/Functions/MathGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public MathGenerator()

ReflectHelper.FastGetMethod(Math.Pow, default(double), default(double)),

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
ReflectHelper.FastGetMethod(MathF.Sin, default(float)),
ReflectHelper.FastGetMethod(MathF.Cos, default(float)),
ReflectHelper.FastGetMethod(MathF.Tan, default(float)),
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Linq/Functions/RoundGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public RoundGenerator()
ReflectHelper.FastGetMethod(decimal.Round, default(decimal)),
ReflectHelper.FastGetMethod(decimal.Round, default(decimal), default(int)),

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
ReflectHelper.FastGetMethod(MathF.Round, default(float)),
ReflectHelper.FastGetMethod(MathF.Round, default(float), default(int)),
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/NHibernate/Linq/Functions/StringGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject,

public class ReplaceGenerator : BaseHqlGeneratorForMethod
{
#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
private static readonly MethodInfo MethodWithComparer = ReflectHelper.GetMethodDefinition<string>(x => x.Replace(string.Empty, string.Empty, default(StringComparison)));
#endif

Expand All @@ -279,15 +279,15 @@ public ReplaceGenerator()
{
ReflectHelper.GetMethodDefinition<string>(s => s.Replace(' ', ' ')),
ReflectHelper.GetMethodDefinition<string>(s => s.Replace("", "")),
#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
MethodWithComparer,
#endif
};
}

public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
{
#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
LogIgnoredStringComparisonParameter(method, MethodWithComparer);
#endif
return treeBuilder.MethodCall(
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Linq/Functions/TruncateGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public TruncateGenerator()
ReflectHelper.FastGetMethod(Math.Truncate, default(double)),
ReflectHelper.FastGetMethod(decimal.Truncate, default(decimal)),

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
ReflectHelper.FastGetMethod(MathF.Truncate, default(float)),
#endif
};
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Linq/Visitors/ExpressionKeyVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected override Expression VisitMember(MemberExpression expression)
return expression;
}

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
protected override Expression VisitInvocation(InvocationExpression expression)
{
if (ExpressionsHelper.TryGetDynamicMemberBinder(expression, out var memberBinder))
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Linq/Visitors/ExpressionParameterVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected override Expression VisitMethodCall(MethodCallExpression expression)
return base.VisitMethodCall(expression);
}

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
protected override Expression VisitInvocation(InvocationExpression expression)
{
if (ExpressionsHelper.TryGetDynamicMemberBinder(expression, out _))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private HqlTreeNode VisitNhNominated(NhNominatedExpression nhNominatedExpression

private HqlTreeNode VisitInvocationExpression(InvocationExpression expression)
{
#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
if (ExpressionsHelper.TryGetDynamicMemberBinder(expression, out var binder))
{
return _hqlTreeBuilder.Dot(
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Linq/Visitors/ParameterTypeLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private bool IsDynamicMember(Expression expression)
{
switch (expression)
{
#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
case InvocationExpression invocationExpression:
// session.Query<Product>().Where("Properties.Name == @0", "First Product")
return ExpressionsHelper.TryGetDynamicMemberBinder(invocationExpression, out _);
Expand Down
13 changes: 9 additions & 4 deletions src/NHibernate/NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,23 @@
<Reference Include="System.Configuration" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<Content Include="*.xsd">
<PackagePath>./</PackagePath>
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Proxy/FieldInterceptorProxyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static TypeInfo CreateProxyType(System.Type baseType)

var assemblyBuilder = ProxyBuilderHelper.DefineDynamicAssembly(AppDomain.CurrentDomain, name);

#if NETFX || NETCOREAPP2_0_OR_GREATER
#if NETFX || NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
if (!baseType.IsVisible)
ProxyBuilderHelper.GenerateInstanceOfIgnoresAccessChecksToAttribute(assemblyBuilder, baseType.Assembly.GetName().Name);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Proxy/NHibernateProxyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public TypeInfo CreateProxyType(System.Type baseType, IReadOnlyCollection<System
interfaces.Add(baseType);
}

#if NETFX || NETCOREAPP2_0_OR_GREATER
#if NETFX || NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
var assemblyNamesToIgnoreAccessCheck =
new[] {baseType}
.Concat(interfaces).Where(i => !i.IsVisible)
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate/Util/ExpressionsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static MemberInfo DecodeMemberAccessExpression<TEntity, TResult>(Expressi
return ((MemberExpression)expression.Body).Member;
}

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
/// <summary>
/// Try to retrieve <see cref="GetMemberBinder"/> from a reduced <see cref="ExpressionType.Dynamic"/> expression.
/// </summary>
Expand Down Expand Up @@ -721,7 +721,7 @@ protected override Expression VisitMember(MemberExpression node)
return base.Visit(node.Expression);
}

#if NETCOREAPP2_0_OR_GREATER
#if NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER
protected override Expression VisitInvocation(InvocationExpression node)
{
if (TryGetDynamicMemberBinder(node, out var binder))
Expand Down