From 9843c0c8de992d678aa3dbbe200974e8e025b639 Mon Sep 17 00:00:00 2001 From: Christopher Jolly Date: Tue, 11 Oct 2022 00:51:07 +0800 Subject: [PATCH] Update DesignTimeService for Net 6 --- .../Design/Internal/JetDesignTimeServices.cs | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs b/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs index 90690d0..793fa2b 100644 --- a/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs +++ b/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs @@ -5,7 +5,9 @@ using EntityFrameworkCore.Jet.Infrastructure.Internal; using EntityFrameworkCore.Jet.Internal; using EntityFrameworkCore.Jet.Scaffolding.Internal; using EntityFrameworkCore.Jet.Storage.Internal; +using EntityFrameworkCore.Jet.Update.Internal; using Microsoft.EntityFrameworkCore.Design; +using Microsoft.EntityFrameworkCore.Design.Internal; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Scaffolding; using Microsoft.EntityFrameworkCore.Storage; @@ -28,12 +30,22 @@ namespace EntityFrameworkCore.Jet.Design.Internal /// doing so can result in application failures when updating to a new Entity Framework Core release. /// public virtual void ConfigureDesignTimeServices(IServiceCollection serviceCollection) - => serviceCollection - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton(); + { + serviceCollection.AddEntityFrameworkJet(); +#pragma warning disable EF1001 // Internal EF Core API usage. + new EntityFrameworkRelationalDesignServicesBuilder(serviceCollection) + .TryAdd() + .TryAdd() + .TryAdd() +#pragma warning restore EF1001 // Internal EF Core API usage. + .TryAdd() + .TryAdd() + .TryAddProviderSpecificServices( + b => b + .TryAddSingleton() + .TryAddSingleton() + .TryAddScoped()) + .TryAddCoreServices(); + } } } \ No newline at end of file