From 7a55852cbb223f6c00d81a5e6d9e02fbce3db1d7 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 17 Feb 2020 08:52:05 +0100 Subject: [PATCH] Update editor config to not force private constants to be named `_camelCase` --- .editorconfig | 12 +++++++++--- .../HttpContextVariationContextAccessor.cs | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5a35b71ce6..5d270b1db0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -25,16 +25,22 @@ dotnet_naming_rule.private_members_with_underscore.severity = suggestion dotnet_naming_symbols.private_fields.applicable_kinds = field dotnet_naming_symbols.private_fields.applicable_accessibilities = private +dotnet_naming_symbols.private_fields.required_modifiers = abstract,async,readonly,static # all except const dotnet_naming_style.prefix_underscore.capitalization = camel_case dotnet_naming_style.prefix_underscore.required_prefix = _ + + + + + # https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/ide/editorconfig-code-style-settings-reference.md [*.cs] csharp_style_var_for_built_in_types = true:suggestion csharp_style_var_when_type_is_apparent = true:suggestion csharp_style_var_elsewhere = true:suggestion -csharp_prefer_braces = false : none +csharp_prefer_braces = false : none -[*.{js,less}] -trim_trailing_whitespace = false +[*.{js,less}] +trim_trailing_whitespace = false diff --git a/src/Umbraco.Abstractions/Models/PublishedContent/HttpContextVariationContextAccessor.cs b/src/Umbraco.Abstractions/Models/PublishedContent/HttpContextVariationContextAccessor.cs index 41b81a4a6e..09604281dc 100644 --- a/src/Umbraco.Abstractions/Models/PublishedContent/HttpContextVariationContextAccessor.cs +++ b/src/Umbraco.Abstractions/Models/PublishedContent/HttpContextVariationContextAccessor.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Models.PublishedContent public class HttpContextVariationContextAccessor : IVariationContextAccessor { private readonly IRequestCache _requestCache; - private const string _contextKey = "Umbraco.Web.Models.PublishedContent.DefaultVariationContextAccessor"; + private const string ContextKey = "Umbraco.Web.Models.PublishedContent.DefaultVariationContextAccessor"; /// /// Initializes a new instance of the class. @@ -22,8 +22,8 @@ namespace Umbraco.Web.Models.PublishedContent /// public VariationContext VariationContext { - get => (VariationContext) _requestCache.Get(_contextKey); - set => _requestCache.Set(_contextKey, value); + get => (VariationContext) _requestCache.Get(ContextKey); + set => _requestCache.Set(ContextKey, value); } } }