public static object GetService(object context, Type serviceType) { var service = FindService(context, serviceType); if (service == null) throw new Exception(string.Format("Service of the type {0} is not available.", serviceType)); return service; }
/// <summary> /// Gets the default error log implementation specified in the /// configuration file, or the in-memory log implemention if /// none is configured. /// </summary> public static ErrorLog GetDefault(HttpContextBase context) { return((ErrorLog)ServiceCenter.GetService(context, typeof(ErrorLog))); }