Skip to content

Commit 982c46a

Browse files
committed
Add IMysqlJsonOptions into the EF serviceCollection
1 parent e511295 commit 982c46a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/EFCore.MySql.Json.Microsoft/Design/Internal/MySqlJsonMicrosoftDesignTimeServices.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Storage.Internal;
88
using Microsoft.EntityFrameworkCore.Storage;
99
using Microsoft.Extensions.DependencyInjection;
10+
using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure;
11+
using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure.Internal;
1012

1113
namespace Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Design.Internal
1214
{
@@ -26,6 +28,7 @@ public class MySqlJsonMicrosoftDesignTimeServices : IDesignTimeServices
2628
/// </summary>
2729
public virtual void ConfigureDesignTimeServices(IServiceCollection serviceCollection)
2830
=> serviceCollection
31+
.AddSingleton<IMysqlJsonOptions, DefaultMysqlJsonOptions>()
2932
.AddSingleton<IRelationalTypeMappingSourcePlugin, MySqlJsonMicrosoftTypeMappingSourcePlugin>()
3033
.AddSingleton<IProviderCodeGeneratorPlugin, MySqlJsonMicrosoftCodeGeneratorPlugin>();
3134
}

src/EFCore.MySql.Json.Microsoft/Extensions/MySqlJsonMicrosoftServiceCollectionExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Storage.Internal;
99
using Microsoft.EntityFrameworkCore.Storage;
1010
using Microsoft.EntityFrameworkCore.Utilities;
11+
using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure;
12+
using Pomelo.EntityFrameworkCore.MySql.Json.Microsoft.Infrastructure.Internal;
1113
using Pomelo.EntityFrameworkCore.MySql.Query.ExpressionTranslators.Internal;
1214

1315
// ReSharper disable once CheckNamespace
@@ -33,7 +35,9 @@ public static IServiceCollection AddEntityFrameworkMySqlJsonMicrosoft(
3335
.TryAdd<IMethodCallTranslatorPlugin, MySqlJsonMicrosoftMethodCallTranslatorPlugin>()
3436
.TryAdd<IMemberTranslatorPlugin, MySqlJsonMicrosoftMemberTranslatorPlugin>()
3537
.TryAddProviderSpecificServices(
36-
x => x.TryAddScopedEnumerable<IMySqlJsonPocoTranslator, MySqlJsonMicrosoftPocoTranslator>());
38+
x => x
39+
.TryAddSingleton<IMysqlJsonOptions, DefaultMysqlJsonOptions>()
40+
.TryAddScopedEnumerable<IMySqlJsonPocoTranslator, MySqlJsonMicrosoftPocoTranslator>());
3741

3842
return serviceCollection;
3943
}

0 commit comments

Comments
 (0)