GetService() public static méthode

Gets a service of a given type based on a given context. If the service is not available, an exception is thrown.
public static GetService ( object context, Type serviceType ) : object
context object
serviceType System.Type
Résultat object
Exemple #1
0
        /// <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)));
        }