Files
Umbraco-CMS/src/Umbraco.Core/Configuration/ModelsModeExtensions.cs

29 lines
1.1 KiB
C#
Raw Normal View History

using Umbraco.Core.Configuration;
namespace Umbraco.Configuration
2019-06-24 11:58:36 +02:00
{
/// <summary>
/// Provides extensions for the <see cref="ModelsMode"/> enumeration.
/// </summary>
public static class ModelsModeExtensions
{
/// <summary>
/// Gets a value indicating whether the mode is LiveAnything or PureLive.
/// </summary>
public static bool IsLive(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.PureLive || modelsMode == ModelsMode.LiveAppData;
2019-06-24 11:58:36 +02:00
/// <summary>
/// Gets a value indicating whether the mode is LiveAnything but not PureLive.
/// </summary>
public static bool IsLiveNotPure(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.LiveAppData;
2019-06-24 11:58:36 +02:00
/// <summary>
/// Gets a value indicating whether the mode supports explicit generation (as opposed to pure live).
/// </summary>
public static bool SupportsExplicitGeneration(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.AppData || modelsMode == ModelsMode.LiveAppData;
2019-06-24 11:58:36 +02:00
}
}