diff --git a/src/EFCore.MySql.Json.Microsoft/Design/Internal/MySqlJsonMicrosoftDesignTimeServices.cs b/src/EFCore.MySql.Json.Microsoft/Design/Internal/MySqlJsonMicrosoftDesignTimeServices.cs index 72593fa78..e5193d9ea 100644 --- a/src/EFCore.MySql.Json.Microsoft/Design/Internal/MySqlJsonMicrosoftDesignTimeServices.cs +++ b/src/EFCore.MySql.Json.Microsoft/Design/Internal/MySqlJsonMicrosoftDesignTimeServices.cs @@ -7,6 +7,8 @@ using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Storage.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.Extensions.DependencyInjection; +using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure; +using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure.Internal; namespace Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Design.Internal { @@ -26,6 +28,7 @@ public class MySqlJsonMicrosoftDesignTimeServices : IDesignTimeServices /// public virtual void ConfigureDesignTimeServices(IServiceCollection serviceCollection) => serviceCollection + .AddSingleton() .AddSingleton() .AddSingleton(); } diff --git a/src/EFCore.MySql.Json.Microsoft/Extensions/MySqlJsonMicrosoftServiceCollectionExtensions.cs b/src/EFCore.MySql.Json.Microsoft/Extensions/MySqlJsonMicrosoftServiceCollectionExtensions.cs index 18f35e7d8..d94a4d283 100644 --- a/src/EFCore.MySql.Json.Microsoft/Extensions/MySqlJsonMicrosoftServiceCollectionExtensions.cs +++ b/src/EFCore.MySql.Json.Microsoft/Extensions/MySqlJsonMicrosoftServiceCollectionExtensions.cs @@ -8,6 +8,8 @@ using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Storage.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Utilities; +using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure; +using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure.Internal; using Pomelo.EntityFrameworkCore.MySql.Query.ExpressionTranslators.Internal; // ReSharper disable once CheckNamespace @@ -33,7 +35,9 @@ public static IServiceCollection AddEntityFrameworkMySqlJsonMicrosoft( .TryAdd() .TryAdd() .TryAddProviderSpecificServices( - x => x.TryAddScopedEnumerable()); + x => x + .TryAddSingleton() + .TryAddScopedEnumerable()); return serviceCollection; }