Skip to content

Commit 3de3b2e

Browse files
committed
Rename RegisterInstanceProvider to RegisterProvider to be reusable
1 parent 0a2a436 commit 3de3b2e

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/UnityContainerAttributeRegistration/Attribute/RegisterInstanceProviderAttribute.cs renamed to src/UnityContainerAttributeRegistration/Attribute/RegisterProviderAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace UnityContainerAttributeRegistration.Attribute
77
/// Mark a type to be a provider for <see cref="RegisterInstanceAttribute" />
88
/// </summary>
99
[AttributeUsage(AttributeTargets.Class)]
10-
public class RegisterInstanceProviderAttribute : System.Attribute
10+
public class RegisterProviderAttribute : System.Attribute
1111
{
1212
}
1313
}

src/UnityContainerAttributeRegistration/Populator/InstancePopulator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public InstancePopulator(IAssemblyProvider appDomain) : base(appDomain)
3636
/// <exception cref="InvalidOperationException">Class type must not be static or abstract.</exception>
3737
public override IUnityContainer Populate(IUnityContainer container)
3838
{
39-
IList<Type> typesWithAttribute = GetTypesWith<RegisterInstanceProviderAttribute>(TypeDefined.Inherit)
39+
IList<Type> typesWithAttribute = GetTypesWith<RegisterProviderAttribute>(TypeDefined.Inherit)
4040
.ToList();
4141

4242
IEnumerable<InstanceToRegister> instancesToRegister =
@@ -54,7 +54,7 @@ public override IUnityContainer Populate(IUnityContainer container)
5454
}
5555

5656
/// <summary>
57-
/// Create a list of <see cref="InstanceToRegister" /> depending on class marked with <see cref="RegisterInstanceProviderAttribute" />
57+
/// Create a list of <see cref="InstanceToRegister" /> depending on class marked with <see cref="RegisterProviderAttribute" />
5858
/// </summary>
5959
/// <param name="container"><see cref="IUnityContainer" /> to resolve <paramref name="providerClassType" /></param>
6060
/// <param name="providerClassType">Class type used to search for <see cref="RegisterInstanceAttribute" /></param>

src/UnityContainerAttributeRegistrationTest/Assets/RegistertInstanceTestClasses/TestClasses.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace UnityContainerAttributeRegistrationTest.Assets.RegistertInstanceTestClasses
77
{
8-
[RegisterInstanceProvider]
8+
[RegisterProvider]
99
public class DefaultProvider
1010
{
1111
[RegisterInstance]
@@ -15,7 +15,7 @@ public AnyClass Value
1515
}
1616
}
1717

18-
[RegisterInstanceProvider]
18+
[RegisterProvider]
1919
public class ProviderUsingFromWithoutLifetimeManager
2020
{
2121
[RegisterInstance(typeof(IAnyInterface))]
@@ -25,7 +25,7 @@ public AnyClass Value
2525
}
2626
}
2727

28-
[RegisterInstanceProvider]
28+
[RegisterProvider]
2929
public class ProviderUsingFromWithSingletonLifetimeManager
3030
{
3131
[RegisterInstance(typeof(IAnyInterface), typeof(SingletonLifetimeManager))]
@@ -35,7 +35,7 @@ public AnyClass Value
3535
}
3636
}
3737

38-
[RegisterInstanceProvider]
38+
[RegisterProvider]
3939
public class ProviderUsingFromWithContainerControlledLifetimeManager
4040
{
4141
[RegisterInstance(typeof(IAnyInterface), typeof(ContainerControlledLifetimeManager))]
@@ -45,7 +45,7 @@ public AnyClass Value
4545
}
4646
}
4747

48-
[RegisterInstanceProvider]
48+
[RegisterProvider]
4949
public class ProviderUsingFromWithExternallyControlledLifetimeManager
5050
{
5151
[RegisterInstance(typeof(IAnyInterface), typeof(ExternallyControlledLifetimeManager))]
@@ -55,7 +55,7 @@ public AnyClass Value
5555
}
5656
}
5757

58-
[RegisterInstanceProvider]
58+
[RegisterProvider]
5959
public class ProviderWithExternallyControlledLifetimeManager
6060
{
6161
[RegisterInstance(null, typeof(ExternallyControlledLifetimeManager))]
@@ -65,7 +65,7 @@ public AnyClass Value
6565
}
6666
}
6767

68-
[RegisterInstanceProvider]
68+
[RegisterProvider]
6969
public class ProviderWithLifetimemanagerWithoutInterface
7070
{
7171
[RegisterInstance(null, typeof(LifetimeManagerWithoutInterface))]
@@ -75,12 +75,12 @@ public AnyClass Value
7575
}
7676
}
7777

78-
[RegisterInstanceProvider]
78+
[RegisterProvider]
7979
public static class StaticClassWithAttribute
8080
{
8181
}
8282

83-
[RegisterInstanceProvider]
83+
[RegisterProvider]
8484
public abstract class AbstractClassWithAttribute
8585
{
8686
}

0 commit comments

Comments
 (0)