From 97f2d50838ea7e0b51e88857641c25110f969389 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Thu, 17 Dec 2020 16:14:18 -0800 Subject: [PATCH] Updated following design meeting feedback --- ...ingExpressionVisitor.QueryingEnumerable.cs | 2 +- ...ssionVisitor.ReadItemQueryingEnumerable.cs | 2 +- ...osShapedQueryCompilingExpressionVisitor.cs | 3 ++- .../Storage/Internal/CosmosClientWrapper.cs | 2 +- ...ingExpressionVisitor.QueryingEnumerable.cs | 2 +- src/EFCore.Relational/Migrations/Migration.cs | 5 ++-- .../Properties/RelationalStrings.Designer.cs | 6 +++++ .../Properties/RelationalStrings.resx | 3 +++ .../Query/EntityProjectionExpression.cs | 2 +- .../Internal/FromSqlQueryingEnumerable.cs | 2 +- .../Internal/SingleQueryingEnumerable.cs | 2 +- .../Query/Internal/SplitQueryingEnumerable.cs | 2 +- .../Storage/IRelationalCommand.cs | 3 +-- .../Storage/IRelationalConnection.cs | 12 ++------- .../Properties/SqlServerStrings.Designer.cs | 6 +++++ .../Properties/SqlServerStrings.resx | 3 +++ .../Internal/SqlServerSqlGenerationHelper.cs | 3 ++- src/EFCore/Properties/CoreStrings.Designer.cs | 12 +++++++++ src/EFCore/Properties/CoreStrings.resx | 6 +++++ src/EFCore/Storage/IDbContextTransaction.cs | 9 ++++--- .../RelationalEventIdTest.cs | 6 ++--- .../TestRelationalCommandBuilderFactory.cs | 6 +++++ .../SqlServerDatabaseCreatorTest.cs | 25 ++++++++----------- .../SqlServerSequenceValueGeneratorTest.cs | 5 ++++ .../Query/BadDataSqliteTest.cs | 4 +-- 25 files changed, 83 insertions(+), 50 deletions(-) diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs index e9ddd77e85f..37fbc34aa32 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs @@ -179,7 +179,7 @@ public void Dispose() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); } private sealed class AsyncEnumerator : IAsyncEnumerator diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs index aded41b25fd..08234303fb5 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs @@ -290,7 +290,7 @@ public ValueTask DisposeAsync() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); private bool ShapeResult() { diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs index 87ac9c41f9b..a46dd21dcd7 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs @@ -4,6 +4,7 @@ using System; using System.Linq.Expressions; using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Utilities; using Newtonsoft.Json.Linq; @@ -110,7 +111,7 @@ protected override Expression VisitShapedQuery(ShapedQueryExpression shapedQuery QueryCompilationContext.QueryTrackingBehavior == QueryTrackingBehavior.NoTrackingWithIdentityResolution)); default: - throw new NotSupportedException(); + throw new NotSupportedException(CoreStrings.UnhandledExpressionNode(shapedQueryExpression.QueryExpression)); } } } diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs index 64bb5575bcf..1d3fac45397 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs @@ -763,7 +763,7 @@ public void Dispose() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); } } diff --git a/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs b/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs index e8ec003a1a6..6daac465530 100644 --- a/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs +++ b/src/EFCore.InMemory/Query/Internal/InMemoryShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs @@ -160,7 +160,7 @@ public ValueTask DisposeAsync() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); } } } diff --git a/src/EFCore.Relational/Migrations/Migration.cs b/src/EFCore.Relational/Migrations/Migration.cs index 6c6631fc216..fd38f5dc7c3 100644 --- a/src/EFCore.Relational/Migrations/Migration.cs +++ b/src/EFCore.Relational/Migrations/Migration.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations.Operations; @@ -118,9 +119,7 @@ protected virtual void BuildTargetModel([NotNull] ModelBuilder modelBuilder) /// /// The that will build the operations. protected virtual void Down([NotNull] MigrationBuilder migrationBuilder) - { - throw new NotImplementedException(); - } + => throw new NotSupportedException(RelationalStrings.MigrationDownMissing); private List BuildOperations(Action buildAction) { diff --git a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs index c85bae2f92e..64e2006bce7 100644 --- a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs +++ b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs @@ -720,6 +720,12 @@ public static string LastUsedWithoutOrderBy([CanBeNull] object? method) GetString("LastUsedWithoutOrderBy", nameof(method)), method); + /// + /// The 'Down' method for this migration has not been implemented. Both the 'Up' abd 'Down' methods must be implemented to support reverting migrations. + /// + public static string MigrationDownMissing + => GetString("MigrationDownMissing"); + /// /// The entity type '{entityType}' is mapped to the DbFunction named '{functionName}', but no DbFunction with that name was found in the model. Ensure that the entity type mapping is configured using the model name of a function in the model. /// diff --git a/src/EFCore.Relational/Properties/RelationalStrings.resx b/src/EFCore.Relational/Properties/RelationalStrings.resx index 754546450be..ef22fb61b71 100644 --- a/src/EFCore.Relational/Properties/RelationalStrings.resx +++ b/src/EFCore.Relational/Properties/RelationalStrings.resx @@ -608,6 +608,9 @@ Using '{methodName}' on DbSet of '{entityType}' is not supported since '{entityType}' is part of hierarchy and does not contain a discriminator property. + + The 'Down' method for this migration has not been implemented. Both the 'Up' abd 'Down' methods must be implemented to support reverting migrations. + The migration '{migrationName}' was not found. diff --git a/src/EFCore.Relational/Query/EntityProjectionExpression.cs b/src/EFCore.Relational/Query/EntityProjectionExpression.cs index 0f60fd620a6..88d1cf7f1c4 100644 --- a/src/EFCore.Relational/Query/EntityProjectionExpression.cs +++ b/src/EFCore.Relational/Query/EntityProjectionExpression.cs @@ -41,7 +41,7 @@ private readonly IDictionary _ownedNavigati [Obsolete("Use the constructor which takes populated column expressions map.", error: true)] public EntityProjectionExpression([NotNull] IEntityType entityType, [NotNull] TableExpressionBase innerTable, bool nullable) { - throw new NotSupportedException(); + throw new NotSupportedException("Obsolete: Use the constructor which takes populated column expressions map."); } /// diff --git a/src/EFCore.Relational/Query/Internal/FromSqlQueryingEnumerable.cs b/src/EFCore.Relational/Query/Internal/FromSqlQueryingEnumerable.cs index a6acdf63daf..5f61ea4f7ba 100644 --- a/src/EFCore.Relational/Query/Internal/FromSqlQueryingEnumerable.cs +++ b/src/EFCore.Relational/Query/Internal/FromSqlQueryingEnumerable.cs @@ -235,7 +235,7 @@ public void Dispose() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); } private sealed class AsyncEnumerator : IAsyncEnumerator diff --git a/src/EFCore.Relational/Query/Internal/SingleQueryingEnumerable.cs b/src/EFCore.Relational/Query/Internal/SingleQueryingEnumerable.cs index 302ae5b04bf..ac913e11614 100644 --- a/src/EFCore.Relational/Query/Internal/SingleQueryingEnumerable.cs +++ b/src/EFCore.Relational/Query/Internal/SingleQueryingEnumerable.cs @@ -229,7 +229,7 @@ public void Dispose() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); } private sealed class AsyncEnumerator : IAsyncEnumerator diff --git a/src/EFCore.Relational/Query/Internal/SplitQueryingEnumerable.cs b/src/EFCore.Relational/Query/Internal/SplitQueryingEnumerable.cs index 65e933921eb..c6fb4c2a2e7 100644 --- a/src/EFCore.Relational/Query/Internal/SplitQueryingEnumerable.cs +++ b/src/EFCore.Relational/Query/Internal/SplitQueryingEnumerable.cs @@ -235,7 +235,7 @@ public void Dispose() } public void Reset() - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.EnumerableResetNotSupported); } private sealed class AsyncEnumerator : IAsyncEnumerator diff --git a/src/EFCore.Relational/Storage/IRelationalCommand.cs b/src/EFCore.Relational/Storage/IRelationalCommand.cs index f997a27f3fc..4414f4ce16d 100644 --- a/src/EFCore.Relational/Storage/IRelationalCommand.cs +++ b/src/EFCore.Relational/Storage/IRelationalCommand.cs @@ -108,7 +108,6 @@ Task ExecuteReaderAsync( DbCommand CreateDbCommand( RelationalCommandParameterObject parameterObject, Guid commandId, - DbCommandMethod commandMethod) - => throw new NotSupportedException(); + DbCommandMethod commandMethod); } } diff --git a/src/EFCore.Relational/Storage/IRelationalConnection.cs b/src/EFCore.Relational/Storage/IRelationalConnection.cs index c3b17df6172..bd5e111ff5d 100644 --- a/src/EFCore.Relational/Storage/IRelationalConnection.cs +++ b/src/EFCore.Relational/Storage/IRelationalConnection.cs @@ -30,11 +30,7 @@ public interface IRelationalConnection : IRelationalTransactionManager, IDisposa /// /// Gets or sets the connection string for the database. /// - string ConnectionString - { - get => throw new NotSupportedException(); - [param: CanBeNull] set => throw new NotSupportedException(); - } + string ConnectionString { get; [param: CanBeNull] set; } /// /// @@ -47,11 +43,7 @@ string ConnectionString /// Note that the connection must be disposed by application code since it was not created by Entity Framework. /// /// - DbConnection DbConnection - { - get => throw new NotSupportedException(); - [param: CanBeNull] set => throw new NotSupportedException(); - } + DbConnection DbConnection { get; [param: CanBeNull] set; } /// /// The currently in use, or null if not known. diff --git a/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs b/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs index a93b5539286..a555f7c81aa 100644 --- a/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs +++ b/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs @@ -197,6 +197,12 @@ public static string NonKeyValueGeneration([CanBeNull] object? property, [CanBeN GetString("NonKeyValueGeneration", nameof(property), nameof(entityType)), property, entityType); + /// + /// SQL Server does not support releasing a savepoint. + /// + public static string NoSavepointRelease + => GetString("NoSavepointRelease"); + /// /// SQL Server sequences cannot be used to generate values for the property '{property}' on entity type '{entityType}' because the property type is '{propertyType}'. Sequences can only be used with integer properties. /// diff --git a/src/EFCore.SqlServer/Properties/SqlServerStrings.resx b/src/EFCore.SqlServer/Properties/SqlServerStrings.resx index 5667d6b017c..df7acefb11b 100644 --- a/src/EFCore.SqlServer/Properties/SqlServerStrings.resx +++ b/src/EFCore.SqlServer/Properties/SqlServerStrings.resx @@ -262,6 +262,9 @@ The property '{property}' on entity type '{entityType}' is configured to use 'SequenceHiLo' value generator, which is only intended for keys. If this was intentional, configure an alternate key on the property, otherwise call 'ValueGeneratedNever' or configure store generation for this property. + + SQL Server does not support releasing a savepoint. + SQL Server sequences cannot be used to generate values for the property '{property}' on entity type '{entityType}' because the property type is '{propertyType}'. Sequences can only be used with integer properties. diff --git a/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs b/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs index 7dddd502180..3d02eb99547 100644 --- a/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs +++ b/src/EFCore.SqlServer/Storage/Internal/SqlServerSqlGenerationHelper.cs @@ -4,6 +4,7 @@ using System; using System.Text; using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore.SqlServer.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; using Microsoft.Extensions.DependencyInjection; @@ -124,6 +125,6 @@ public override string GenerateRollbackToSavepointStatement(string name) /// The name of the savepoint to be released. /// An SQL string to release the savepoint. public override string GenerateReleaseSavepointStatement(string name) - => throw new NotSupportedException("SQL Server does not support releasing a savepoint"); + => throw new NotSupportedException(SqlServerStrings.NoSavepointRelease); } } diff --git a/src/EFCore/Properties/CoreStrings.Designer.cs b/src/EFCore/Properties/CoreStrings.Designer.cs index 87f5fbb21b9..bd3fa19bf18 100644 --- a/src/EFCore/Properties/CoreStrings.Designer.cs +++ b/src/EFCore/Properties/CoreStrings.Designer.cs @@ -823,6 +823,12 @@ public static string EntityTypesNotInRelationship([CanBeNull] object? invalidDep GetString("EntityTypesNotInRelationship", nameof(invalidDependentType), nameof(invalidPrincipalType), nameof(dependentType), nameof(principalType)), invalidDependentType, invalidPrincipalType, dependentType, principalType); + /// + /// This enumerator cannot be reset. + /// + public static string EnumerableResetNotSupported + => GetString("EnumerableResetNotSupported"); + /// /// Cannot use multiple context instances within a single query execution. Ensure the query uses a single context instance. /// @@ -2284,6 +2290,12 @@ public static string RetryLimitExceeded([CanBeNull] object? retryLimit, [CanBeNu public static string RuntimeParameterMissingParameter => GetString("RuntimeParameterMissingParameter"); + /// + /// Savepoints are not supported by the database provider in use. + /// + public static string SavepointsNotSupported + => GetString("SavepointsNotSupported"); + /// /// The seed entity for entity type '{entityType}' cannot be added because a default value was provided for the required property '{property}'. Please provide a value different from '{defaultValue}'. /// diff --git a/src/EFCore/Properties/CoreStrings.resx b/src/EFCore/Properties/CoreStrings.resx index 2ca18f306ae..d6b2c6b2500 100644 --- a/src/EFCore/Properties/CoreStrings.resx +++ b/src/EFCore/Properties/CoreStrings.resx @@ -423,6 +423,9 @@ The provided entity types '{invalidDependentType}' and '{invalidPrincipalType}' are invalid. Specify '{dependentType}' and '{principalType}', or entity types in the same hierarchy. + + This enumerator cannot be reset. + Cannot use multiple context instances within a single query execution. Ensure the query uses a single context instance. @@ -1288,6 +1291,9 @@ While registering a runtime parameter, the lambda expression must have only one parameter which must be same as 'QueryCompilationContext.QueryContextParameter' expression. + + Savepoints are not supported by the database provider in use. + The seed entity for entity type '{entityType}' cannot be added because a default value was provided for the required property '{property}'. Please provide a value different from '{defaultValue}'. diff --git a/src/EFCore/Storage/IDbContextTransaction.cs b/src/EFCore/Storage/IDbContextTransaction.cs index ca95b9f34e7..69a1b076949 100644 --- a/src/EFCore/Storage/IDbContextTransaction.cs +++ b/src/EFCore/Storage/IDbContextTransaction.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; namespace Microsoft.EntityFrameworkCore.Storage @@ -58,7 +59,7 @@ public interface IDbContextTransaction : IDisposable, IAsyncDisposable /// /// The name of the savepoint to be created. void CreateSavepoint([NotNull] string name) - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.SavepointsNotSupported); /// /// Creates a savepoint in the transaction. This allows all commands that are executed after the savepoint @@ -70,14 +71,14 @@ void CreateSavepoint([NotNull] string name) /// A representing the asynchronous operation. /// If the is canceled. Task CreateSavepointAsync([NotNull] string name, CancellationToken cancellationToken = default) - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.SavepointsNotSupported); /// /// Rolls back all commands that were executed after the specified savepoint was established. /// /// The name of the savepoint to roll back to. void RollbackToSavepoint([NotNull] string name) - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.SavepointsNotSupported); /// /// Rolls back all commands that were executed after the specified savepoint was established. @@ -87,7 +88,7 @@ void RollbackToSavepoint([NotNull] string name) /// A representing the asynchronous operation. /// If the is canceled. Task RollbackToSavepointAsync([NotNull] string name, CancellationToken cancellationToken = default) - => throw new NotSupportedException(); + => throw new NotSupportedException(CoreStrings.SavepointsNotSupported); /// /// diff --git a/test/EFCore.Relational.Tests/RelationalEventIdTest.cs b/test/EFCore.Relational.Tests/RelationalEventIdTest.cs index de5a222b310..97f6a7fba73 100644 --- a/test/EFCore.Relational.Tests/RelationalEventIdTest.cs +++ b/test/EFCore.Relational.Tests/RelationalEventIdTest.cs @@ -172,11 +172,9 @@ public string FindMigrationId(string nameOrId) private class FakeRelationalConnection : IRelationalConnection { - public string ConnectionString - => throw new NotImplementedException(); + public string ConnectionString { get; set; } - public DbConnection DbConnection - => new FakeDbConnection(); + public DbConnection DbConnection { get; set; } = new FakeDbConnection(); public DbContext Context => null; diff --git a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs index a534ec6a3e5..ece420e46ef 100644 --- a/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs +++ b/test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestRelationalCommandBuilderFactory.cs @@ -1,9 +1,12 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.Collections.Generic; +using System.Data.Common; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage; @@ -203,6 +206,9 @@ public async Task ExecuteReaderAsync( return result; } + public DbCommand CreateDbCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod) + => throw new NotImplementedException(); + private int? PreExecution(IRelationalConnection connection) { int? errorNumber = null; diff --git a/test/EFCore.SqlServer.Tests/SqlServerDatabaseCreatorTest.cs b/test/EFCore.SqlServer.Tests/SqlServerDatabaseCreatorTest.cs index 49055c09b8e..46dd32da2ab 100644 --- a/test/EFCore.SqlServer.Tests/SqlServerDatabaseCreatorTest.cs +++ b/test/EFCore.SqlServer.Tests/SqlServerDatabaseCreatorTest.cs @@ -3,9 +3,11 @@ using System; using System.Collections.Generic; +using System.Data.Common; using System.Threading; using System.Threading.Tasks; using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; using Microsoft.EntityFrameworkCore.Storage; @@ -265,9 +267,7 @@ public IReadOnlyDictionary ParameterValues => throw new NotImplementedException(); public int ExecuteNonQuery(RelationalCommandParameterObject parameterObject) - { - return 0; - } + => 0; public Task ExecuteNonQueryAsync( RelationalCommandParameterObject parameterObject, @@ -275,28 +275,23 @@ public Task ExecuteNonQueryAsync( => Task.FromResult(0); public RelationalDataReader ExecuteReader(RelationalCommandParameterObject parameterObject) - { - throw new NotImplementedException(); - } + => throw new NotImplementedException(); public Task ExecuteReaderAsync( RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } + => throw new NotImplementedException(); + + public DbCommand CreateDbCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod) + => throw new NotImplementedException(); public object ExecuteScalar(RelationalCommandParameterObject parameterObject) - { - throw new NotImplementedException(); - } + => throw new NotImplementedException(); public Task ExecuteScalarAsync( RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } + => throw new NotImplementedException(); } } } diff --git a/test/EFCore.SqlServer.Tests/SqlServerSequenceValueGeneratorTest.cs b/test/EFCore.SqlServer.Tests/SqlServerSequenceValueGeneratorTest.cs index c55eb098c55..c05db4b378e 100644 --- a/test/EFCore.SqlServer.Tests/SqlServerSequenceValueGeneratorTest.cs +++ b/test/EFCore.SqlServer.Tests/SqlServerSequenceValueGeneratorTest.cs @@ -3,10 +3,12 @@ using System; using System.Collections.Generic; +using System.Data.Common; using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal; @@ -277,6 +279,9 @@ public Task ExecuteReaderAsync( { throw new NotImplementedException(); } + + public DbCommand CreateDbCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod) + => throw new NotImplementedException(); } } } diff --git a/test/EFCore.Sqlite.FunctionalTests/Query/BadDataSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Query/BadDataSqliteTest.cs index 537313ef181..8c2ac9f0e49 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Query/BadDataSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Query/BadDataSqliteTest.cs @@ -376,8 +376,8 @@ public IDbContextTransaction CurrentTransaction public SemaphoreSlim Semaphore { get; } - public string ConnectionString { get; } - public DbConnection DbConnection { get; } + public string ConnectionString { get; set; } + public DbConnection DbConnection { get; set; } public DbContext Context => null;