Skip to content
This repository was archived by the owner on Nov 2, 2018. It is now read-only.

Commit 8ad97a1

Browse files
committed
Add IDesignTimeServiceProviderFactory
Provides access to the application's IServiceProvider to design-time services. Resolves #524
1 parent 3f65142 commit 8ad97a1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
6+
namespace Microsoft.Extensions.DependencyInjection
7+
{
8+
/// <summary>
9+
/// A factory for creating the application's <see cref="IServiceProvider"/> at design time. Implement this interface
10+
/// to enable design-time services that need access to the application's services. Design-time services will
11+
/// automatically discover implementations of this interface.
12+
/// </summary>
13+
public interface IDesignTimeServiceProviderFactory
14+
{
15+
/// <summary>
16+
/// Creates a new instance of the application's <see cref="IServiceProvider"/>.
17+
/// </summary>
18+
/// <param name="args">Arguments provided by the design-time service.</param>
19+
/// <returns>The application's <see cref="IServiceProvider"/>.</returns>
20+
IServiceProvider CreateServiceProvider(string[] args);
21+
}
22+
}

0 commit comments

Comments
 (0)