Ejemplo n.º 1
0
        /// <summary>
        /// Returns the alternate platform given a platform. For example, if <see cref="Platform.Windows"/> is provided, <see cref="Platform.NonWindows"/> is returned, and vice-versa.
        /// </summary>
        public static Platform GetAlternatePlatform(Platform platform)
        {
            switch (platform)
            {
            case Platform.NonWindows:
                return(Platform.Windows);

            case Platform.Windows:
                return(Platform.NonWindows);

            default:
                throw EnumerationHelper.UnexpectedEnumerationValueException(platform);
            }
        }
Ejemplo n.º 2
0
        public static string ToStringStandard(this ServiceLifetime serviceLifetime)
        {
            switch (serviceLifetime)
            {
            case ServiceLifetime.Scoped:
                return(ServiceLifetimeHelper.ScopedStandardRepresentation);

            case ServiceLifetime.Singleton:
                return(ServiceLifetimeHelper.SingletonStandardRepresentation);

            case ServiceLifetime.Transient:
                return(ServiceLifetimeHelper.TransientStandardRepresentation);

            default:
                throw EnumerationHelper.UnexpectedEnumerationValueException(serviceLifetime);
            }
        }