- 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:
Bjarke Berg
2020-03-03 14:15:30 +01:00
parent 341ac1c46b
commit 2d175ffb86
15 changed files with 48 additions and 29 deletions

View 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;
}
}
}