Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to add design-time services #29068

Open
Tracked by #22945
ajcvickers opened this issue Sep 13, 2022 · 0 comments
Open
Tracked by #22945

Make it easier to add design-time services #29068

ajcvickers opened this issue Sep 13, 2022 · 0 comments

Comments

@ajcvickers
Copy link
Member

See dotnet/EntityFramework.Docs#4013

Specifically, not needing to do this manually:

var provider = context.GetService<IDatabaseProvider>().Name;
var providerAssembly = Assembly.Load(new AssemblyName(provider));	
var providerServicesAttribute = providerAssembly.GetCustomAttribute<DesignTimeProviderServicesAttribute>();
var designTimeServicesType = providerAssembly.GetType(providerServicesAttribute.TypeName, throwOnError: true);
((IDesignTimeServices)Activator.CreateInstance(designTimeServicesType)!).ConfigureDesignTimeServices(serviceCollection);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants