Skip to content

Commit

Permalink
(GH-1287) Non-internal SimpleInjector XML Comments
Browse files Browse the repository at this point in the history
SimpleInjector is no longer internalized, so that can cause an
ambiguous conflict when adding the Chocolatey library to a codebase.
Add XML comments in the API to note this for all methods that call into
the container.
  • Loading branch information
ferventcoder committed May 14, 2017
1 parent 581db01 commit aa654e4
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/chocolatey/GetChocolatey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private static void add_assembly_resolver()
/// <summary>
/// The place where all the magic happens.
/// </summary>
/// <remarks>Chocolatey - the most magical place on Windows</remarks>
public class GetChocolatey
{
private readonly Container _container;
Expand Down Expand Up @@ -129,9 +130,12 @@ public GetChocolatey Set(Action<ChocolateyConfiguration> propConfig)
/// <param name="service">The service.</param>
/// <param name="implementation">The implementation.</param>
/// <returns>This <see cref="GetChocolatey"/> instance</returns>
/// <remarks>
/// This requires you to use ILMerged SimpleInjector. If you use SimpleInjector in your codebase, you must now use Chocolatey's version. This is required to not be internalized so licensed code will work appropriately.
/// </remarks>
public GetChocolatey RegisterContainerComponent(Type service, Type implementation)
{
_container.Register(service,implementation,Lifestyle.Singleton);
_container.Register(service, implementation, Lifestyle.Singleton);
return this;
}

Expand All @@ -142,8 +146,11 @@ public GetChocolatey RegisterContainerComponent(Type service, Type implementatio
/// <typeparam name="Service">The type of the service.</typeparam>
/// <typeparam name="Implementation">The type of the Implementation.</typeparam>
/// <returns>This <see cref="GetChocolatey"/> instance</returns>
public GetChocolatey RegisterContainerComponent<Service,Implementation>()
where Service : class
/// <remarks>
/// This requires you to use ILMerged SimpleInjector. If you use SimpleInjector in your codebase, you must now use Chocolatey's version. This is required to not be internalized so licensed code will work appropriately.
/// </remarks>
public GetChocolatey RegisterContainerComponent<Service, Implementation>()
where Service : class
where Implementation : class, Service
{
return RegisterContainerComponent<Service, Implementation>(Lifestyle.Singleton);
Expand All @@ -152,14 +159,16 @@ public GetChocolatey RegisterContainerComponent<Service,Implementation>()
/// <summary>
/// Registers a container component.
/// Will override existing component if registered.
/// NOTE: This requires you take a dependency on SimpleInjector.
/// </summary>
/// <typeparam name="Service">The type of the service.</typeparam>
/// <typeparam name="Implementation">The type of the Implementation.</typeparam>
/// <param name="lifestyle">The lifestyle.</param>
/// <returns>This <see cref="GetChocolatey"/> instance</returns>
public GetChocolatey RegisterContainerComponent<Service,Implementation>(Lifestyle lifestyle)
where Service : class
/// <remarks>
/// This requires you to use ILMerged SimpleInjector. If you use SimpleInjector in your codebase, you must now use Chocolatey's version. This is required to not be internalized so licensed code will work appropriately.
/// </remarks>
public GetChocolatey RegisterContainerComponent<Service, Implementation>(Lifestyle lifestyle)
where Service : class
where Implementation : class, Service
{
_container.Register<Service, Implementation>(lifestyle);
Expand All @@ -173,6 +182,9 @@ public GetChocolatey RegisterContainerComponent<Service,Implementation>(Lifestyl
/// <typeparam name="Service">The type of the ervice.</typeparam>
/// <param name="implementationCreator">The implementation creator.</param>
/// <returns>This <see cref="GetChocolatey"/> instance</returns>
/// <remarks>
/// This requires you to use ILMerged SimpleInjector. If you use SimpleInjector in your codebase, you must now use Chocolatey's version. This is required to not be internalized so licensed code will work appropriately.
/// </remarks>
public GetChocolatey RegisterContainerComponent<Service>(Func<Service> implementationCreator)
where Service : class
{
Expand All @@ -183,10 +195,12 @@ public GetChocolatey RegisterContainerComponent<Service>(Func<Service> implement
/// <summary>
/// Register container components when you need to do multiple setups and want to work with the container directly.
/// Will override existing components if registered.
/// NOTE: This requires you take a dependency on SimpleInjector.
/// </summary>
/// <param name="containerSetup">The container setup.</param>
/// <returns>This <see cref="GetChocolatey"/> instance</returns>
/// <remarks>
/// This requires you to use ILMerged SimpleInjector. If you use SimpleInjector in your codebase, you must now use Chocolatey's version. This is required to not be internalized so licensed code will work appropriately.
/// </remarks>
public GetChocolatey RegisterContainerComponents(Action<Container> containerSetup)
{
if (containerSetup != null)
Expand Down

0 comments on commit aa654e4

Please sign in to comment.