Rename models builder modes (#10272)

* Renaming AppData Models Builder mode

* Renaming PureLive Models Builder mode to Runtime

* ModelsBuilderAssembly attribute flags if models are "Live" or not

* Updated ModelsMode names

* Only add tag if it is not a pull request. Apparently this is not allowed when it is from a fork.

* Revert "Only add tag if it is not a pull request. Apparently this is not allowed when it is from a fork."

This reverts commit 92b33f3c

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Callum Whyte
2021-05-26 07:36:21 +01:00
committed by GitHub
parent 0358e2aff7
commit b07f6519e7
21 changed files with 554 additions and 546 deletions

View File

@@ -8,21 +8,21 @@ namespace Umbraco.Extensions
public static class ModelsModeExtensions
{
/// <summary>
/// Gets a value indicating whether the mode is LiveAnything or PureLive.
/// Gets a value indicating whether the mode is *Auto.
/// </summary>
public static bool IsLive(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.PureLive || modelsMode == ModelsMode.LiveAppData;
public static bool IsAuto(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.InMemoryAuto || modelsMode == ModelsMode.SourceCodeAuto;
/// <summary>
/// Gets a value indicating whether the mode is LiveAnything but not PureLive.
/// Gets a value indicating whether the mode is *Auto but not InMemory.
/// </summary>
public static bool IsLiveNotPure(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.LiveAppData;
public static bool IsAutoNotInMemory(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.SourceCodeAuto;
/// <summary>
/// Gets a value indicating whether the mode supports explicit generation (as opposed to pure live).
/// Gets a value indicating whether the mode supports explicit manual generation.
/// </summary>
public static bool SupportsExplicitGeneration(this ModelsMode modelsMode)
=> modelsMode == ModelsMode.AppData || modelsMode == ModelsMode.LiveAppData;
=> modelsMode == ModelsMode.SourceCodeManual || modelsMode == ModelsMode.SourceCodeAuto;
}
}