diff options
Diffstat (limited to 'src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs')
| -rw-r--r-- | src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs b/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs new file mode 100644 index 00000000..f4a5e8c3 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/ServiceProviderExtensions.cs | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Extensibility.Services | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | |||
| 7 | public static class ServiceProviderExtensions | ||
| 8 | { | ||
| 9 | public static T GetService<T>(this IServiceProvider serviceProvider) where T : class | ||
| 10 | { | ||
| 11 | return (T)serviceProvider.GetService(typeof(T)); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | } | ||
