Class RecipeDuplicateIdentityValidation
Refuses a view whose options — or whose options' submit signals — cannot be told apart. A recipe matches both by Guid, so two options of one view, or two signals of one option, sharing a Guid leave it guessing: a guess edits the wrong one, or appends one more on every import. A Guid shared on the asset the recipe would update, or in the recipe itself, is reported as an error naming the asset and the Guid, and nothing is written to that view until each carries a Guid of its own. A recipe entry the merge refused — for claiming a Guid another option or signal already owns, or for naming by its Id (an option) or its position and type (a signal) an element that carries a different Guid (RecipeIdentityConflict) — is described here too, so every identity conflict reads the same way in the report (RecipeUiOptionMerger, RecipeSignalListMerger).
Inherited Members
Namespace: Serenity.ProjectRecipe.Infrastructure.Editor.Importers
Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
Syntax
public static class RecipeDuplicateIdentityValidation
Methods
DescribeRefusals(string, RecipeIdentityRefusals, RecipeIdentityRefusals)
Describes each recipe option and signal the merge left out of the view at
assetPath: for claiming a Guid another one already owns, or for naming by its fallback
key an element of another identity.
Declaration
public static IEnumerable<string> DescribeRefusals(string assetPath, RecipeIdentityRefusals optionRefusals, RecipeIdentityRefusals signalRefusals)
Parameters
| Type | Name | Description |
|---|---|---|
| string | assetPath | The view's asset path, named in every message. |
| RecipeIdentityRefusals | optionRefusals | The options the option merge refused. |
| RecipeIdentityRefusals | signalRefusals | The submit signals the signal merges refused, over every option. |
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | One warning per refused entry. |
Validate(SerenityRecipeImportContext, string, string, string, UiOption[], RecipeUiOptionDto[], bool)
Checks the options existingOptions the view at assetPath
owns now and the recipe's recipeOptions for a Guid claimed twice, reporting each as an
error when report is true.
Declaration
public static bool Validate(SerenityRecipeImportContext context, string section, string viewId, string assetPath, UiOption[] existingOptions, RecipeUiOptionDto[] recipeOptions, bool report)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipeImportContext | context | The run's context, whose report receives the errors. |
| string | section | The recipe section (for the report). |
| string | viewId | The view's recipe id (for the report). |
| string | assetPath | The view's asset path, named in every error. |
| UiOption[] | existingOptions | The options the view owns now; null when it does not exist yet. |
| RecipeUiOptionDto[] | recipeOptions | The recipe's options for the view (may be null). |
| bool | report | False when used as a quiet import gate. |
Returns
| Type | Description |
|---|---|
| bool | True when every option, and every signal of each option, can be told apart. |