Example #1
0
 /// <summary>
 /// 按给定的key取任意已经提供的服务。
 /// </summary>
 /// <param name="typeName">服务类型名</param>
 /// <param name="MapKey">服务标识</param>
 /// <param name="Params">获取服务的参数</param>
 /// <returns></returns>
 public static object GetServiceByKey(string MapKey, string typeName, params object[] Params)
 {
     return(MapContainer.GetInstance(MapKey, typeName, Params));
 }
Example #2
0
 /// <summary>
 /// 取任意已经提供的服务,如果存在多个,则返回第一个。
 /// </summary>
 /// <param name="typeName">服务类型名</param>
 /// <param name="Params">获取服务的参数</param>
 /// <returns></returns>
 public static object GetService(string typeName, params object[] Params)
 {
     return(MapContainer.GetInstance(typeName, "", Params));
 }
Example #3
0
 /// <summary>
 /// 按给定的key取任意已经提供的服务。
 /// </summary>
 /// <typeparam name="T">服务类型</typeparam>
 /// <param name="MapKey">服务标识</param>
 /// <param name="Params">获取服务的参数</param>
 /// <returns></returns>
 public static T GetServiceByKey <T>(string MapKey, params object[] Params) where T : class
 {
     return(MapContainer.GetInstance(MapKey, typeof(T).FullName, Params) as T);
 }
Example #4
0
 public static object GetServiceByKey <T>(string MapKey)
 {
     return(MapContainer.GetInstance(MapKey));
 }
Example #5
0
 /// <summary>
 /// 取任意已经提供的服务,如果存在多个,则返回第一个。
 /// </summary>
 /// <typeparam name="T">服务类型</typeparam>
 /// <param name="Params">获取服务的参数</param>
 /// <returns></returns>
 public static T GetService <T>(params object[] Params) where T : class
 {
     return(MapContainer.GetInstance("", typeof(T).FullName, Params) as T);
 }