// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.Framework.Internal;
namespace Microsoft.AspNet.Hosting
{
public static class HostingEnvironmentExtensions
{
///
/// Compares the current hosting environment name against the specified value.
///
/// An instance of service.
/// Environment name to validate against.
/// True if the specified name is same as the current environment.
public static bool IsEnvironment(
[NotNull]this IHostingEnvironment hostingEnvironment,
[NotNull]string environmentName)
{
return string.Equals(
hostingEnvironment.EnvironmentName,
environmentName,
StringComparison.OrdinalIgnoreCase);
}
}
}