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

29 lines
1.1 KiB
C#
Raw Normal View History

using Umbraco.Cms.Core.Configuration;
namespace Umbraco.Extensions
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 *Auto.
2019-06-24 11:58:36 +02:00
/// </summary>
public static bool IsAuto(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.InMemoryAuto || modelsMode == ModelsMode.SourceCodeAuto;
2019-06-24 11:58:36 +02:00
/// <summary>
/// Gets a value indicating whether the mode is *Auto but not InMemory.
2019-06-24 11:58:36 +02:00
/// </summary>
public static bool IsAutoNotInMemory(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.SourceCodeAuto;
2019-06-24 11:58:36 +02:00
/// <summary>
/// Gets a value indicating whether the mode supports explicit manual generation.
2019-06-24 11:58:36 +02:00
/// </summary>
public static bool SupportsExplicitGeneration(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.SourceCodeManual || modelsMode == ModelsMode.SourceCodeAuto;
2019-06-24 11:58:36 +02:00
}
}