@@ -72,7 +72,38 @@ public AutoSubstituteBuilder ConfigureBuilder(Action<ContainerBuilder> action)
72
72
}
73
73
74
74
/// <summary>
75
- /// Register the specified implementation type to the container as the specified service type and resolve it using the given parameters.
75
+ /// Register the specified implementation type to the container as itself with the given parameterst.
76
+ /// </summary>
77
+ /// <typeparam name="TService">The type to register the implementation as</typeparam>
78
+ /// <typeparam name="TImplementation">The implementation type</typeparam>
79
+ /// <param name="parameters">Optional constructor parameters</param>
80
+ /// <returns>The current <see cref="AutoSubstituteBuilder"/>.</returns>
81
+ public AutoSubstituteBuilder Provide < TService > ( params Parameter [ ] parameters )
82
+ => Provide < TService , TService > ( out _ , parameters ) ;
83
+
84
+ /// <summary>
85
+ /// Register the specified implementation type to the container as itself with the given parameterst.
86
+ /// </summary>
87
+ /// <typeparam name="TService">The type to register the implementation as</typeparam>
88
+ /// <typeparam name="TImplementation">The implementation type</typeparam>
89
+ /// <param name="providedValue">Parameter to obtain a provided value.</param>
90
+ /// <param name="parameters">Optional constructor parameters</param>
91
+ /// <returns>The current <see cref="AutoSubstituteBuilder"/>.</returns>
92
+ public AutoSubstituteBuilder Provide < TService > ( out IProvidedValue < TService > providedValue , params Parameter [ ] parameters )
93
+ => Provide < TService , TService > ( out providedValue , parameters ) ;
94
+
95
+ /// <summary>
96
+ /// Register the specified implementation type to the container as the specified service type with the given parameterst.
97
+ /// </summary>
98
+ /// <typeparam name="TService">The type to register the implementation as</typeparam>
99
+ /// <typeparam name="TImplementation">The implementation type</typeparam>
100
+ /// <param name="parameters">Optional constructor parameters</param>
101
+ /// <returns>The current <see cref="AutoSubstituteBuilder"/>.</returns>
102
+ public AutoSubstituteBuilder Provide < TService , TImplementation > ( params Parameter [ ] parameters )
103
+ => Provide < TService , TImplementation > ( out _ , parameters ) ;
104
+
105
+ /// <summary>
106
+ /// Register the specified implementation type to the container as the specified service type with the given parameterst.
76
107
/// </summary>
77
108
/// <typeparam name="TService">The type to register the implementation as</typeparam>
78
109
/// <typeparam name="TImplementation">The implementation type</typeparam>
@@ -155,6 +186,8 @@ public SubstituteForBuilder<TService> SubstituteForPartsOf<TService>(params obje
155
186
/// <typeparam name="TService">The type to register and return a substitute for</typeparam>
156
187
/// <param name="parameters">Any constructor parameters that Autofac can't resolve automatically</param>
157
188
/// <returns>The current <see cref="AutoSubstituteBuilder"/>.</returns>
189
+ [ Obsolete ( "Use a Provide method instead" ) ]
190
+ [ System . ComponentModel . EditorBrowsable ( System . ComponentModel . EditorBrowsableState . Never ) ]
158
191
public AutoSubstituteBuilder ResolveAndSubstituteFor < TService > ( params Parameter [ ] parameters ) where TService : class
159
192
{
160
193
_builder . RegisterType < TService > ( )
0 commit comments