Skip to content

Commit

Permalink
[ConstructorMapFactory] Refactor interfaces to create the two differe…
Browse files Browse the repository at this point in the history
…nt types of factory.
  • Loading branch information
Aleksbgbg committed Jun 22, 2019
1 parent e133612 commit 9737e30
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
16 changes: 13 additions & 3 deletions Wingman/DI/Constructor/ConstructorMapFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
using System;

internal class ConstructorMapFactory : IConstructorMapFactory
internal class ConstructorMapFactory : IArgumentConstructorMapFactory, IDiConstructorMapFactory
{
private readonly IConstructorQueryProvider _constructorQueryProvider;

Expand All @@ -11,9 +11,19 @@ public ConstructorMapFactory(IConstructorQueryProvider constructorQueryProvider)
_constructorQueryProvider = constructorQueryProvider;
}

public IArgumentConstructorMap CreateConstructorMap(Type concreteType)
IArgumentConstructorMap IArgumentConstructorMapFactory.CreateConstructorMap(Type concreteType)
{
return new ConstructorMap(_constructorQueryProvider, concreteType);
return CreateConstructorMap(concreteType);
}

IDiConstructorMap IDiConstructorMapFactory.CreateConstructorMap(Type implementation)
{
return CreateConstructorMap(implementation);
}

private ConstructorMap CreateConstructorMap(Type type)
{
return new ConstructorMap(_constructorQueryProvider, type);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
using System;

internal interface IConstructorMapFactory
internal interface IArgumentConstructorMapFactory
{
IArgumentConstructorMap CreateConstructorMap(Type concreteType);
}
Expand Down
9 changes: 9 additions & 0 deletions Wingman/DI/Constructor/IDiConstructorMapFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Wingman.DI.Constructor
{
using System;

internal interface IDiConstructorMapFactory
{
IDiConstructorMap CreateConstructorMap(Type implementation);
}
}

0 comments on commit 9737e30

Please sign in to comment.