Skip to content

Commit

Permalink
Releasing 2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ENikS committed Mar 4, 2018
1 parent a3d1964 commit e4e886e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<Version>2.0.7</Version>
<PackageReleaseNotes>This package is compatible with NET Core 1.1, 2.0+</PackageReleaseNotes>
<Version>2.0.8</Version>
<PackageReleaseNotes>Bug fixes and minor performance optimizations</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup>
Expand Down
7 changes: 6 additions & 1 deletion src/ServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ public IServiceScope CreateScope()
#endregion


#region ConfigureServices
#region Public Members

public static IServiceProvider ConfigureServices(IServiceCollection services)
{
return new ServiceProvider(new UnityContainer().AddExtension(new MdiExtension())
.AddServices(services));
}

public static explicit operator UnityContainer(ServiceProvider c)
{
return (UnityContainer)c._container;
}

#endregion


Expand Down
26 changes: 26 additions & 0 deletions src/ServiceProviderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,31 @@ public static IServiceProvider BuildServiceProvider(this IServiceCollection serv
return new ServiceProvider(new UnityContainer().AddExtension(new MdiExtension())
.AddServices(services));
}

/// <summary>
/// Creates a <see cref="ServiceProvider"/> containing services from the provided <see cref="IServiceCollection"/>
/// optionaly enabling scope validation.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> containing service descriptors.</param>
/// <param name="container">Parent container</param>
/// <returns>Service provider</returns>
public static IServiceProvider BuildServiceProvider(this IServiceCollection services, IUnityContainer container)
{
return new ServiceProvider(container.AddExtension(new MdiExtension())
.AddServices(services));
}

/// <summary>
/// Creates a <see cref="ServiceProvider"/> containing services from the provided <see cref="IServiceCollection"/>
/// optionaly enabling scope validation.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> containing service descriptors.</param>
/// <param name="container">Parent container</param>
/// <returns>Service provider</returns>
public static IServiceProvider BuildServiceProvider(this IUnityContainer container, IServiceCollection services)
{
return new ServiceProvider(container.AddExtension(new MdiExtension())
.AddServices(services));
}
}
}

0 comments on commit e4e886e

Please sign in to comment.