/// <summary> /// Sets the tags for a property type with the correct variance /// </summary> /// <remarks> /// Used to safely set a value for a property taking into account if the property type varies by culture/segment. /// If varying by culture it will assign the value to the default language only. /// If varying by segment it will assign the value to no segment. /// </remarks> public static void AssignInvariantOrDefaultCultureTags( this IContentBase content, string propertyTypeAlias, IEnumerable <string> tags, IContentTypeComposition contentType, ILocalizationService localizationService, bool merge = false) { if (contentType is null) { throw new ArgumentNullException(nameof(contentType)); } var variesByCulture = VariesByCulture(propertyTypeAlias, contentType); content.AssignTags( propertyTypeAlias, tags, merge, variesByCulture ? localizationService.GetDefaultLanguageIsoCode() : null); }