net 6 update

pull/131/head
Christopher Jolly 4 years ago
parent b1fa143d4d
commit 426240084d

@ -1,34 +1,34 @@
<Project>
<PropertyGroup>
<DotnetRuntimeVersion>5.0.6</DotnetRuntimeVersion>
<EFCoreVersion>[$(DotnetRuntimeVersion), 6.0.0)</EFCoreVersion>
<DotnetRuntimeVersion>6.0.0</DotnetRuntimeVersion>
<EFCoreVersion>[$(DotnetRuntimeVersion), 7.0.0)</EFCoreVersion>
</PropertyGroup>
<ItemGroup>
<!-- Common -->
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="5.0.1" />
<PackageReference Update="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" />
<PackageReference Update="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<!-- EntityFrameworkCore.Jet.Data -->
<PackageReference Update="System.ValueTuple" Version="4.5.0" />
<PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Update="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Update="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" />
<!-- EFCore.Jet -->
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Update="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Update="System.Collections.Immutable" Version="6.0.0" />
<PackageReference Update="System.ComponentModel.Annotations" Version="6.0.0" />
<!--<PackageReference Update="Microsoft.EntityFrameworkCore" Version="$(MicrosoftEntityFrameworkCoreVersion)" />-->
<!--<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(MicrosoftEntityFrameworkCoreRelationalVersion)" />-->
<!--<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsConfigurationJsonVersion)" />-->
@ -37,8 +37,8 @@
<!--<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />-->
<!-- Tests -->
<PackageReference Update="System.Data.Odbc" Version="5.0.0" />
<PackageReference Update="System.Data.OleDb" Version="5.0.0" />
<PackageReference Update="System.Data.Odbc" Version="6.0.0" />
<PackageReference Update="System.Data.OleDb" Version="6.0.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="$(EFCoreVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="$(EFCoreVersion)" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.9.4" />
@ -60,7 +60,7 @@
<PackageReference Update="xunit.assert" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Update="xunit.runner.console" Version="2.4.1" />
<PackageReference Update="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<!--<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesVersion)" />-->
<!--<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsConfigurationJsonVersion)" />-->
<!--<PackageReference Update="System.Data.Odbc" Version="$(SystemDataOdbcVersion)" />-->
@ -82,7 +82,7 @@
<!-- EFCore.Jet.Tests -->
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
<PackageReference Update="Moq" Version="4.16.1" />
<!--<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="$(MicrosoftEntityFrameworkCoreDesignVersion)" />-->
<!--<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(MicrosoftEntityFrameworkCoreRelationalVersion)" />-->

@ -23,9 +23,9 @@
</PropertyGroup>
<PropertyGroup>
<DefaultNetCoreTargetFramework>net5.0</DefaultNetCoreTargetFramework>
<WindowsOnlyNetCoreTargetFramework>net5.0-windows</WindowsOnlyNetCoreTargetFramework>
<DefaultNetCoreLegacyTargetFramework>netcoreapp5.0</DefaultNetCoreLegacyTargetFramework>
<DefaultNetCoreTargetFramework>net6.0</DefaultNetCoreTargetFramework>
<WindowsOnlyNetCoreTargetFramework>net6.0-windows</WindowsOnlyNetCoreTargetFramework>
<DefaultNetCoreLegacyTargetFramework>netcoreapp6.0</DefaultNetCoreLegacyTargetFramework>
<DefaultNetStandardTargetFramework>netstandard2.1</DefaultNetStandardTargetFramework>
</PropertyGroup>

@ -8,7 +8,7 @@
- "rtm"
- "servicing"
-->
<VersionPrefix>5.0.0</VersionPrefix>
<VersionPrefix>6.0.0</VersionPrefix>
<PreReleaseVersionLabel>alpha</PreReleaseVersionLabel>
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>

@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.203",
"version": "6.0.100",
"allowPrerelease": false,
"rollForward": "latestFeature"
}

@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Jet/ACE data provider for .NET used by EntityFramworkCore.Jet (Microsoft Access MDB/ACCDB files).</Description>
<TargetFramework>$(DefaultNetStandardTargetFramework)</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<Platforms>AnyCPU;x86;x64</Platforms>
<AssemblyName>EntityFrameworkCore.Jet.Data</AssemblyName>
<RootNamespace>EntityFrameworkCore.Jet.Data</RootNamespace>

@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Explicit ODBC support for Jet/ACE database provider for Entity Framework Core (Microsoft Access MDB/ACCDB files).</Description>
<TargetFramework>$(WindowsOnlyNetCoreTargetFramework)</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyName>EntityFrameworkCore.Jet.Odbc</AssemblyName>
<RootNamespace>EntityFrameworkCore.Jet</RootNamespace>
<PackageTags>$(PackageTags);ODBC;System.Data.Odbc</PackageTags>

@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Explicit OLE DB support for Jet/ACE database provider for Entity Framework Core (Microsoft Access MDB/ACCDB files).</Description>
<TargetFramework>$(WindowsOnlyNetCoreTargetFramework)</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyName>EntityFrameworkCore.Jet.OleDb</AssemblyName>
<RootNamespace>EntityFrameworkCore.Jet</RootNamespace>
<PackageTags>$(PackageTags);OLE DB;OLEDB;System.Data.OleDb</PackageTags>

@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Jet/ACE database provider for Entity Framework Core (Microsoft Access MDB/ACCDB files).</Description>
<TargetFramework>$(DefaultNetStandardTargetFramework)</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<RootNamespace>EntityFrameworkCore.Jet</RootNamespace>
<AssemblyName>EntityFrameworkCore.Jet</AssemblyName>
<Platforms>AnyCPU;x86;x64</Platforms>

@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="model"> The model. </param>
/// <returns> The default identity seed. </returns>
public static int GetIdentitySeed([NotNull] this IModel model)
public static int GetIdentitySeed([NotNull] this IReadOnlyModel model)
=> (int?) model[JetAnnotationNames.IdentitySeed] ?? 1;
/// <summary>
@ -53,7 +53,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="model"> The model. </param>
/// <returns> The default identity increment. </returns>
public static int GetIdentityIncrement([NotNull] this IModel model)
public static int GetIdentityIncrement([NotNull] this IReadOnlyModel model)
=> (int?) model[JetAnnotationNames.IdentityIncrement] ?? 1;
/// <summary>
@ -93,7 +93,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="model"> The model. </param>
/// <returns> The default <see cref="JetValueGenerationStrategy" />. </returns>
public static JetValueGenerationStrategy? GetValueGenerationStrategy([NotNull] this IModel model)
public static JetValueGenerationStrategy? GetValueGenerationStrategy([NotNull] this IReadOnlyModel model)
=> (JetValueGenerationStrategy?) model[JetAnnotationNames.ValueGenerationStrategy];
/// <summary>

@ -22,7 +22,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="property"> The property. </param>
/// <returns> The identity seed. </returns>
public static int? GetIdentitySeed([NotNull] this IProperty property)
public static int? GetIdentitySeed([NotNull] this IReadOnlyProperty property)
=> (int?)property[JetAnnotationNames.IdentitySeed];
/// <summary>
@ -31,7 +31,7 @@ namespace Microsoft.EntityFrameworkCore
/// <param name="property"> The property. </param>
/// <param name="storeObject"> The identifier of the store object. </param>
/// <returns> The identity seed. </returns>
public static int? GetIdentitySeed([NotNull] this IProperty property, in StoreObjectIdentifier storeObject)
public static int? GetIdentitySeed([NotNull] this IReadOnlyProperty property, in StoreObjectIdentifier storeObject)
{
var annotation = property.FindAnnotation(JetAnnotationNames.IdentitySeed);
if (annotation != null)
@ -88,7 +88,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="property"> The property. </param>
/// <returns> The identity increment. </returns>
public static int? GetIdentityIncrement([NotNull] this IProperty property)
public static int? GetIdentityIncrement([NotNull] this IReadOnlyProperty property)
=> (int?)property[JetAnnotationNames.IdentityIncrement];
/// <summary>
@ -97,7 +97,7 @@ namespace Microsoft.EntityFrameworkCore
/// <param name="property"> The property. </param>
/// <param name="storeObject"> The identifier of the store object. </param>
/// <returns> The identity increment. </returns>
public static int? GetIdentityIncrement([NotNull] this IProperty property, in StoreObjectIdentifier storeObject)
public static int? GetIdentityIncrement([NotNull] this IReadOnlyProperty property, in StoreObjectIdentifier storeObject)
{
var annotation = property.FindAnnotation(JetAnnotationNames.IdentityIncrement);
if (annotation != null)
@ -159,7 +159,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="property"> The property. </param>
/// <returns> The strategy, or <see cref="JetValueGenerationStrategy.None" /> if none was set. </returns>
public static JetValueGenerationStrategy GetValueGenerationStrategy([NotNull] this IProperty property)
public static JetValueGenerationStrategy GetValueGenerationStrategy([NotNull] this IReadOnlyProperty property)
{
var annotation = property.FindAnnotation(JetAnnotationNames.ValueGenerationStrategy);
if (annotation != null)
@ -190,7 +190,7 @@ namespace Microsoft.EntityFrameworkCore
/// <param name="storeObject"> The identifier of the store object. </param>
/// <returns> The strategy, or <see cref="JetValueGenerationStrategy.None" /> if none was set. </returns>
public static JetValueGenerationStrategy GetValueGenerationStrategy(
[NotNull] this IProperty property,
[NotNull] this IReadOnlyProperty property,
in StoreObjectIdentifier storeObject)
{
var annotation = property.FindAnnotation(JetAnnotationNames.ValueGenerationStrategy);
@ -220,7 +220,7 @@ namespace Microsoft.EntityFrameworkCore
return GetDefaultValueGenerationStrategy(property);
}
private static JetValueGenerationStrategy GetDefaultValueGenerationStrategy(IProperty property)
private static JetValueGenerationStrategy GetDefaultValueGenerationStrategy(IReadOnlyProperty property)
{
var modelStrategy = property.DeclaringEntityType.Model.GetValueGenerationStrategy();
@ -262,7 +262,7 @@ namespace Microsoft.EntityFrameworkCore
return value;
}
private static void CheckValueGenerationStrategy(IProperty property, JetValueGenerationStrategy? value)
private static void CheckValueGenerationStrategy(IReadOnlyProperty property, JetValueGenerationStrategy? value)
{
if (value != null)
{
@ -292,7 +292,7 @@ namespace Microsoft.EntityFrameworkCore
/// </summary>
/// <param name="property"> The property. </param>
/// <returns> <c>true</c> if compatible. </returns>
public static bool IsCompatibleWithValueGeneration([NotNull] IProperty property)
public static bool IsCompatibleWithValueGeneration([NotNull] IReadOnlyProperty property)
{
var type = property.ClrType;

@ -175,7 +175,7 @@ namespace EntityFrameworkCore.Jet.Infrastructure.Internal
private sealed class ExtensionInfo : RelationalExtensionInfo
{
private long? _serviceProviderHash;
private int? _serviceProviderHash;
private string _logFragment;
public ExtensionInfo(IDbContextOptionsExtension extension)
@ -227,12 +227,12 @@ namespace EntityFrameworkCore.Jet.Infrastructure.Internal
}
}
public override long GetServiceProviderHashCode()
public override int GetServiceProviderHashCode()
{
if (_serviceProviderHash == null)
{
_serviceProviderHash = (base.GetServiceProviderHashCode() * 397) ^
(Extension._dataAccessProviderFactory?.GetHashCode() ?? 0L) ^
(Extension._dataAccessProviderFactory?.GetHashCode() ?? 0) ^
(Extension._useOuterSelectSkipEmulationViaDataReader.GetHashCode() * 397) ^
(Extension._enableMillisecondsSupport.GetHashCode() * 397)/* ^
(Extension._rowNumberPaging?.GetHashCode() ?? 0L)*/;

@ -91,12 +91,12 @@ namespace EntityFrameworkCore.Jet.Internal
&& (ConfigurationSource.Convention.Overrides(property.GetPrecisionConfigurationSource())
|| ConfigurationSource.Convention.Overrides(property.GetScaleConfigurationSource())))
{
logger.DecimalTypeDefaultWarning(property);
logger.DecimalTypeDefaultWarning((IProperty)property);
}
if (property.IsKey())
{
logger.DecimalTypeKeyWarning(property);
logger.DecimalTypeKeyWarning((IProperty)property);
}
}
}

@ -82,7 +82,7 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
}
}
static bool IsStrategyNoneNeeded(IProperty property, StoreObjectIdentifier storeObject)
static bool IsStrategyNoneNeeded(IReadOnlyProperty property, StoreObjectIdentifier storeObject)
{
if (property.ValueGenerated == ValueGenerated.OnAdd
&& property.GetDefaultValue(storeObject) == null

@ -75,7 +75,7 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
/// <param name="property"> The property. </param>
/// <param name="storeObject"> The identifier of the store object. </param>
/// <returns> The store value generation strategy to set for the given property. </returns>
public static new ValueGenerated? GetValueGenerated([NotNull] IProperty property, in StoreObjectIdentifier storeObject)
public static ValueGenerated? GetValueGenerated([NotNull] IProperty property, in StoreObjectIdentifier storeObject)
=> RelationalValueGenerationConvention.GetValueGenerated(property, storeObject)
?? (property.GetValueGenerationStrategy(storeObject) != JetValueGenerationStrategy.None
? ValueGenerated.OnAdd

@ -37,7 +37,6 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
private readonly ITypeMappingSource _typeMappingSource;
private readonly IJetOptions _options;
private readonly JetSqlExpressionFactory _sqlExpressionFactory;
private readonly ISqlGenerationHelper _sqlGenerationHelper;
private CoreTypeMapping _boolTypeMapping;
@ -47,12 +46,10 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
/// </summary>
public JetQuerySqlGenerator(
[NotNull] QuerySqlGeneratorDependencies dependencies,
ISqlExpressionFactory sqlExpressionFactory,
ITypeMappingSource typeMappingSource,
IJetOptions options)
: base(dependencies)
{
_sqlExpressionFactory = (JetSqlExpressionFactory) sqlExpressionFactory;
_typeMappingSource = typeMappingSource;
_options = options;
_sqlGenerationHelper = dependencies.SqlGenerationHelper;
@ -250,11 +247,12 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
return base.VisitOrdering(orderingExpression);
}
protected override Expression VisitSqlBinary(SqlBinaryExpression sqlBinaryExpression)
{
Check.NotNull(sqlBinaryExpression, nameof(sqlBinaryExpression));
if (sqlBinaryExpression.OperatorType == ExpressionType.Coalesce)
/*if (sqlBinaryExpression.OperatorType == ExpressionType.Coalesce)
{
Visit(
_sqlExpressionFactory.Case(
@ -266,7 +264,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
},
sqlBinaryExpression.Left));
return sqlBinaryExpression;
}
}*/
return base.VisitSqlBinary(sqlBinaryExpression);
}
@ -288,7 +286,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
// of the returned value using a different (unaligned) type mapping (e.g. date/time related ones).
if (_convertMappings.TryGetValue(convertExpression.Type.Name, out var function))
{
Visit(
/*Visit(
_sqlExpressionFactory.NullChecked(
convertExpression.Operand,
_sqlExpressionFactory.Function(
@ -297,7 +295,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
false,
new[] {false},
typeMapping.ClrType)));
*/
return convertExpression;
}
@ -322,10 +320,6 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
protected override Expression VisitLike(LikeExpression likeExpression)
{
Check.NotNull(likeExpression, nameof(likeExpression));
if (likeExpression.EscapeChar != null)
base.VisitLike(_sqlExpressionFactory.Like(likeExpression.Match, likeExpression.Pattern));
else
base.VisitLike(likeExpression);
return likeExpression;
@ -447,5 +441,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
protected override Expression VisitRowNumber(RowNumberExpression rowNumberExpression)
=> throw new InvalidOperationException(CoreStrings.TranslationFailed(rowNumberExpression));
}
}

@ -14,7 +14,6 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
public class JetQuerySqlGeneratorFactory : IQuerySqlGeneratorFactory
{
[NotNull] private readonly QuerySqlGeneratorDependencies _dependencies;
[NotNull] private readonly JetSqlExpressionFactory _sqlExpressionFactory;
[NotNull] private readonly ITypeMappingSource _typeMappingSource;
[NotNull] private readonly IJetOptions _options;
@ -24,17 +23,15 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
/// </summary>
public JetQuerySqlGeneratorFactory(
[NotNull] QuerySqlGeneratorDependencies dependencies,
[NotNull] ISqlExpressionFactory sqlExpressionFactory,
[NotNull] ITypeMappingSource typeMappingSource,
[NotNull] IJetOptions options)
{
_dependencies = dependencies;
_sqlExpressionFactory = (JetSqlExpressionFactory)sqlExpressionFactory;
_typeMappingSource = typeMappingSource;
_options = options;
}
public virtual QuerySqlGenerator Create()
=> new JetQuerySqlGenerator(_dependencies, _sqlExpressionFactory, _typeMappingSource, _options);
=> new JetQuerySqlGenerator(_dependencies, _typeMappingSource, _options);
}
}

@ -1,5 +1,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Reflection;
using EntityFrameworkCore.Jet.Infrastructure;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
@ -15,6 +18,12 @@ namespace EntityFrameworkCore.Jet.Scaffolding.Internal
/// </summary>
public class JetCodeGenerator : ProviderCodeGenerator
{
private static readonly MethodInfo _useJetMethodInfo
= typeof(JetDbContextOptionsBuilderExtensions).GetRequiredRuntimeMethod(
nameof(JetDbContextOptionsBuilderExtensions.UseJet),
typeof(DbContextOptionsBuilder),
typeof(string),
typeof(Action<JetDbContextOptionsBuilder>));
/// <summary>
/// Initializes a new instance of the <see cref="JetCodeGenerator" /> class.
/// </summary>
@ -33,8 +42,7 @@ namespace EntityFrameworkCore.Jet.Scaffolding.Internal
public override MethodCallCodeFragment GenerateUseProvider(
string connectionString,
MethodCallCodeFragment providerOptions)
=> new MethodCallCodeFragment(
nameof(JetDbContextOptionsBuilderExtensions.UseJet),
=> new(_useJetMethodInfo,
providerOptions == null
? new object[] { connectionString }
: new object[] { connectionString, new NestedClosureCodeFragment("x", providerOptions) });

@ -57,8 +57,7 @@ namespace EntityFrameworkCore.Jet.Storage.Internal
/// </summary>
public override bool HasTables()
{
return Dependencies.ExecutionStrategyFactory
.Create()
return Dependencies.ExecutionStrategy
.Execute(
_relationalConnection,
connection =>
@ -82,7 +81,7 @@ namespace EntityFrameworkCore.Jet.Storage.Internal
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public override Task<bool> HasTablesAsync(CancellationToken cancellationToken = default)
=> Dependencies.ExecutionStrategyFactory.Create().ExecuteAsync(
=> Dependencies.ExecutionStrategy.ExecuteAsync(
_relationalConnection,
async (connection, ct) =>
{

@ -65,7 +65,7 @@ namespace EntityFrameworkCore.Jet.Storage.Internal
.UseJet(connection, b => b.CommandTimeout(CommandTimeout ?? DefaultMasterConnectionCommandTimeout))
.Options;
return new JetRelationalConnection(Dependencies.With(contextOptions));
return new JetRelationalConnection(Dependencies with { ContextOptions = contextOptions });
}
/// <summary>

@ -35,7 +35,7 @@ namespace EntityFrameworkCore.Jet.Update.Internal
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override bool CanAddCommand(ModificationCommand modificationCommand)
protected override bool CanAddCommand(IReadOnlyModificationCommand modificationCommand)
=> ModificationCommands.Count < MaxRowCount;
/// <summary>

@ -36,7 +36,7 @@ namespace EntityFrameworkCore.Jet.Update.Internal
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override void AppendIdentityWhereCondition(StringBuilder commandStringBuilder, ColumnModification columnModification)
protected override void AppendIdentityWhereCondition(StringBuilder commandStringBuilder, IColumnModification columnModification)
{
SqlGenerationHelper.DelimitIdentifier(commandStringBuilder, columnModification.ColumnName);
commandStringBuilder.Append(" = ");

@ -54,6 +54,51 @@ namespace System
return props.SingleOrDefault();
}
public static MethodInfo GetRequiredMethod(this Type type, string name, params Type[] parameters)
{
var method = type.GetTypeInfo().GetMethod(name, parameters);
if (method == null
&& parameters.Length == 0)
{
method = type.GetMethod(name);
}
if (method == null)
{
throw new InvalidOperationException();
}
return method;
}
public static PropertyInfo GetRequiredProperty(this Type type, string name)
=> type.GetTypeInfo().GetProperty(name)
?? throw new InvalidOperationException($"Could not find property '{name}' on type '{type}'");
public static FieldInfo GetRequiredDeclaredField(this Type type, string name)
=> type.GetTypeInfo().GetDeclaredField(name)
?? throw new InvalidOperationException($"Could not find field '{name}' on type '{type}'");
public static MethodInfo GetRequiredDeclaredMethod(this Type type, string name)
=> type.GetTypeInfo().GetDeclaredMethod(name)
?? throw new InvalidOperationException($"Could not find method '{name}' on type '{type}'");
public static MethodInfo GetRequiredDeclaredMethod(this Type type, string name, Func<MethodInfo, bool> methodSelector)
=> type.GetTypeInfo().GetDeclaredMethods(name).Single(methodSelector);
public static PropertyInfo GetRequiredDeclaredProperty(this Type type, string name)
=> type.GetTypeInfo().GetDeclaredProperty(name)
?? throw new InvalidOperationException($"Could not find property '{name}' on type '{type}'");
public static MethodInfo GetRequiredRuntimeMethod(this Type type, string name, params Type[] parameters)
=> type.GetTypeInfo().GetRuntimeMethod(name, parameters)
?? throw new InvalidOperationException($"Could not find method '{name}' on type '{type}'");
public static PropertyInfo GetRequiredRuntimeProperty(this Type type, string name)
=> type.GetTypeInfo().GetRuntimeProperty(name)
?? throw new InvalidOperationException($"Could not find property '{name}' on type '{type}'");
public static bool IsInstantiable(this Type type) => IsInstantiable(type.GetTypeInfo());
private static bool IsInstantiable(TypeInfo type)

Loading…
Cancel
Save