Turned getter-like extension methods into extension properties (#1157)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 13:00:56 +01:00
1 parent 0375318b1b
commit f649febf88
286 files changed
+1379 -1109

No files matched your search

@@ -34,6 +34,6 @@
<AttachDocuments Name="SWOT Analysis Context Material" @bind-DocumentPaths="@this.contextMaterials" UseSmallForm="false" Provider="@this.ProviderSettings"/>
<div style="margin-top: 20px;">
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name())" @bind-Value="@this.selectedTargetLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Target language")" AllowOther="@true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" ValidateOther="@this.ValidateCustomLanguage" />
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name)" @bind-Value="@this.selectedTargetLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Target language")" AllowOther="@true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" ValidateOther="@this.ValidateCustomLanguage" />
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
</div>
@@ -7,7 +7,7 @@ internal static class SwotAnalysisCategoryExtensions
/// <summary>
/// The name of the category in the JSON the models read and write, e.g., "strengths".
/// </summary>
public string JsonName() => category switch
public string JsonName => category switch
{
SwotAnalysisCategory.STRENGTHS => "strengths",
SwotAnalysisCategory.WEAKNESSES => "weaknesses",
@@ -20,7 +20,7 @@ internal static class SwotAnalysisCategoryExtensions
/// <summary>
/// The letter the factor IDs of the category start with, e.g., S1 for the first strength.
/// </summary>
public string FactorIdPrefix() => category switch
public string FactorIdPrefix => category switch
{
SwotAnalysisCategory.STRENGTHS => "S",
SwotAnalysisCategory.WEAKNESSES => "W",
@@ -78,8 +78,8 @@ internal static class SwotAnalysisModeration
string sharedResearch = "")
{
var payload = Enum.GetValues<SwotAnalysisCategory>().ToDictionary(
category => category.JsonName(),
category => CreateCategoryPayload(categories[category], category.FactorIdPrefix()));
category => category.JsonName,
category => CreateCategoryPayload(categories[category], category.FactorIdPrefix));
return $"""
Reconcile these preliminary results of the four SWOT categories. Then write the overall assessment
@@ -152,12 +152,12 @@ internal static class SwotAnalysisModerationResponseParser
/// <returns>The first issue, or an empty string.</returns>
private static string FindIssue(SwotAnalysisCategory category, SwotModeratedCategory moderatedCategory, HashSet<string> factorIds)
{
var name = category.JsonName();
var name = category.JsonName;
var listIssue = FindListIssue(name, moderatedCategory.Findings.Count, moderatedCategory.EmptyMessage);
if (listIssue.Length > 0)
return listIssue;
var prefix = category.FactorIdPrefix();
var prefix = category.FactorIdPrefix;
for (var index = 0; index < moderatedCategory.Findings.Count; index++)
{
var finding = moderatedCategory.Findings[index];