From 896e79f7613a20e1089dc328e9fe76860ff14243 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 28 Feb 2017 08:05:15 +0100 Subject: [PATCH] Consts fixed, super stupid error --- src/Squidex.Core/Identity/SquidexRoles.cs | 8 ++++---- src/Squidex.Write/Schemas/Commands/AddField.cs | 2 +- src/Squidex.Write/Schemas/Commands/CreateSchema.cs | 2 +- src/Squidex.Write/Schemas/SchemaCommandHandler.cs | 2 +- src/Squidex/Config/Identity/IdentityUsage.cs | 2 +- src/Squidex/Config/Identity/LazyClientStore.cs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Squidex.Core/Identity/SquidexRoles.cs b/src/Squidex.Core/Identity/SquidexRoles.cs index ca0e9b3cb..d7e530c9c 100644 --- a/src/Squidex.Core/Identity/SquidexRoles.cs +++ b/src/Squidex.Core/Identity/SquidexRoles.cs @@ -10,12 +10,12 @@ namespace Squidex.Core.Identity { public static class SquidexRoles { - public static readonly string Administrator = "ADMINISTRATOR"; + public const string Administrator = "ADMINISTRATOR"; - public static readonly string AppOwner = "APP-OWNER"; + public const string AppOwner = "APP-OWNER"; - public static readonly string AppEditor = "APP-EDITOR"; + public const string AppEditor = "APP-EDITOR"; - public static readonly string AppDeveloper = "APP-DEVELOPER"; + public const string AppDeveloper = "APP-DEVELOPER"; } } diff --git a/src/Squidex.Write/Schemas/Commands/AddField.cs b/src/Squidex.Write/Schemas/Commands/AddField.cs index eb727c29d..6bb99b5c9 100644 --- a/src/Squidex.Write/Schemas/Commands/AddField.cs +++ b/src/Squidex.Write/Schemas/Commands/AddField.cs @@ -22,7 +22,7 @@ namespace Squidex.Write.Schemas.Commands { if (!Name.IsPropertyName()) { - errors.Add(new ValidationError("DisplayName must be a valid property name", nameof(Name))); + errors.Add(new ValidationError("Name must be a valid property name", nameof(Name))); } if (Properties == null) diff --git a/src/Squidex.Write/Schemas/Commands/CreateSchema.cs b/src/Squidex.Write/Schemas/Commands/CreateSchema.cs index a39858b42..971e94228 100644 --- a/src/Squidex.Write/Schemas/Commands/CreateSchema.cs +++ b/src/Squidex.Write/Schemas/Commands/CreateSchema.cs @@ -48,7 +48,7 @@ namespace Squidex.Write.Schemas.Commands { if (!Name.IsSlug()) { - errors.Add(new ValidationError("DisplayName must be a valid slug", nameof(Name))); + errors.Add(new ValidationError("Name must be a valid slug", nameof(Name))); } } } diff --git a/src/Squidex.Write/Schemas/SchemaCommandHandler.cs b/src/Squidex.Write/Schemas/SchemaCommandHandler.cs index 3ec0c7531..2e8af2d13 100644 --- a/src/Squidex.Write/Schemas/SchemaCommandHandler.cs +++ b/src/Squidex.Write/Schemas/SchemaCommandHandler.cs @@ -35,7 +35,7 @@ namespace Squidex.Write.Schemas if (await schemas.FindSchemaByNameAsync(command.AppId.Id, command.Name) != null) { var error = - new ValidationError($"A schema with name '{command.Name}' already exists", "DisplayName", + new ValidationError($"A schema with name '{command.Name}' already exists", "Name", nameof(CreateSchema.Name)); throw new ValidationException("Cannot create a new schema", error); diff --git a/src/Squidex/Config/Identity/IdentityUsage.cs b/src/Squidex/Config/Identity/IdentityUsage.cs index 8f1dde762..c83eb7a51 100644 --- a/src/Squidex/Config/Identity/IdentityUsage.cs +++ b/src/Squidex/Config/Identity/IdentityUsage.cs @@ -96,7 +96,7 @@ namespace Squidex.Config.Identity public static IApplicationBuilder UseMyApiProtection(this IApplicationBuilder app) { - const string apiScope = Constants.ApiScope; + var apiScope = Constants.ApiScope; var urlsOptions = app.ApplicationServices.GetService>().Value; diff --git a/src/Squidex/Config/Identity/LazyClientStore.cs b/src/Squidex/Config/Identity/LazyClientStore.cs index 8425c4a9a..e3aa1fd61 100644 --- a/src/Squidex/Config/Identity/LazyClientStore.cs +++ b/src/Squidex/Config/Identity/LazyClientStore.cs @@ -93,7 +93,7 @@ namespace Squidex.Config.Identity private static IEnumerable CreateStaticClients(MyUrlsOptions urlsOptions) { - const string id = Constants.FrontendClient; + var id = Constants.FrontendClient; yield return new Client {