- Moved ModelsBuilder constant into Core under constants
- Move the registration of configs into the factory - Moved extension methods of ModelsMode into Umbraco.Core - Removed references to Umbraco.Configuration from Umbraco.Infrastructure and Umbraco.ModelsBuilder.Embedded
This commit is contained in:
39
src/Umbraco.Core/Configuration/ModelsModeExtensions.cs
Normal file
39
src/Umbraco.Core/Configuration/ModelsModeExtensions.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Configuration
|
||||
{
|
||||
/// <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)
|
||||
{
|
||||
return
|
||||
modelsMode == ModelsMode.PureLive
|
||||
|| modelsMode == ModelsMode.LiveAppData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the mode is LiveAnything but not PureLive.
|
||||
/// </summary>
|
||||
public static bool IsLiveNotPure(this ModelsMode modelsMode)
|
||||
{
|
||||
return
|
||||
modelsMode == ModelsMode.LiveAppData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the mode supports explicit generation (as opposed to pure live).
|
||||
/// </summary>
|
||||
public static bool SupportsExplicitGeneration(this ModelsMode modelsMode)
|
||||
{
|
||||
return
|
||||
modelsMode == ModelsMode.AppData
|
||||
|| modelsMode == ModelsMode.LiveAppData;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user