@@ -29,6 +29,21 @@ public static IBindData Alias<TAlias>(this IBindData bindData)
2929 return bindData . Alias ( bindData . Container . Type2Service ( typeof ( TAlias ) ) ) ;
3030 }
3131
32+ /// <summary>
33+ /// 解决服务时触发的回调
34+ /// </summary>
35+ /// <param name="bindData">绑定数据</param>
36+ /// <param name="action">解决事件</param>
37+ /// <returns>服务绑定数据</returns>
38+ public static IBindData OnResolving ( this IBindData bindData , Action action )
39+ {
40+ Guard . Requires < ArgumentNullException > ( action != null ) ;
41+ return bindData . OnResolving ( ( _ , instance ) =>
42+ {
43+ action ( ) ;
44+ } ) ;
45+ }
46+
3247 /// <summary>
3348 /// 解决服务时触发的回调
3449 /// </summary>
@@ -83,15 +98,15 @@ public static IBindData OnResolving<T>(this IBindData bindData, Action<IBindData
8398 }
8499
85100 /// <summary>
86- /// 解决服务时触发的回调
101+ /// 解决服务事件之后的回调
87102 /// </summary>
88103 /// <param name="bindData">绑定数据</param>
89104 /// <param name="action">解决事件</param>
90105 /// <returns>服务绑定数据</returns>
91- public static IBindData OnResolving ( this IBindData bindData , Action action )
106+ public static IBindData OnAfterResolving ( this IBindData bindData , Action action )
92107 {
93108 Guard . Requires < ArgumentNullException > ( action != null ) ;
94- return bindData . OnResolving ( ( _ , instance ) =>
109+ return bindData . OnAfterResolving ( ( _ , instance ) =>
95110 {
96111 action ( ) ;
97112 } ) ;
@@ -149,15 +164,15 @@ public static IBindData OnAfterResolving<T>(this IBindData bindData, Action<IBin
149164 }
150165
151166 /// <summary>
152- /// 解决服务事件之后的回调
167+ /// 当静态服务被释放时
153168 /// </summary>
154169 /// <param name="bindData">绑定数据</param>
155- /// <param name="action">解决事件 </param>
170+ /// <param name="action">处理事件 </param>
156171 /// <returns>服务绑定数据</returns>
157- public static IBindData OnAfterResolving ( this IBindData bindData , Action action )
172+ public static IBindData OnRelease ( this IBindData bindData , Action action )
158173 {
159174 Guard . Requires < ArgumentNullException > ( action != null ) ;
160- return bindData . OnAfterResolving ( ( _ , instance ) =>
175+ return bindData . OnRelease ( ( _ , __ ) =>
161176 {
162177 action ( ) ;
163178 } ) ;
@@ -213,20 +228,5 @@ public static IBindData OnRelease<T>(this IBindData bindData, Action<IBindData,
213228 }
214229 } ) ;
215230 }
216-
217- /// <summary>
218- /// 当静态服务被释放时
219- /// </summary>
220- /// <param name="bindData">绑定数据</param>
221- /// <param name="action">处理事件</param>
222- /// <returns>服务绑定数据</returns>
223- public static IBindData OnRelease ( this IBindData bindData , Action action )
224- {
225- Guard . Requires < ArgumentNullException > ( action != null ) ;
226- return bindData . OnRelease ( ( _ , __ ) =>
227- {
228- action ( ) ;
229- } ) ;
230- }
231231 }
232232}
0 commit comments