From 5f3910bd0ddbf5f78216cb5288fbbd6dc8d27c55 Mon Sep 17 00:00:00 2001 From: Georg von Kries Date: Fri, 12 Apr 2024 14:18:01 +0200 Subject: [PATCH] Use static typing in ContentFieldsProvider instead of dynamic. Fixes #15718 --- .../GraphQL/Fields/ContentFieldsProvider.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs index 23a4db8b563..33a8e130729 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs @@ -21,7 +21,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Boolean field", FieldType = typeof(BooleanGraphType), UnderlyingType = typeof(BooleanField), - FieldAccessor = field => field.Content.Value, + FieldAccessor = field => ((BooleanField)field).Value, } }, { @@ -31,7 +31,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Date field", FieldType = typeof(DateGraphType), UnderlyingType = typeof(DateField), - FieldAccessor = field => field.Content.Value, + FieldAccessor = field => ((DateField)field).Value, } }, { @@ -41,7 +41,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Date & time field", FieldType = typeof(DateTimeGraphType), UnderlyingType = typeof(DateTimeField), - FieldAccessor = field => field.Content.Value, + FieldAccessor = field => ((DateTimeField)field).Value, } }, { @@ -51,7 +51,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Numeric field", FieldType = typeof(DecimalGraphType), UnderlyingType = typeof(NumericField), - FieldAccessor = field => field.Content.Value, + FieldAccessor = field => ((NumericField)field).Value, } }, { @@ -61,7 +61,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Text field", FieldType = typeof(StringGraphType), UnderlyingType = typeof(TextField), - FieldAccessor = field => field.Content.Text, + FieldAccessor = field => ((TextField)field).Text, } }, { @@ -71,7 +71,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Time field", FieldType = typeof(TimeSpanGraphType), UnderlyingType = typeof(TimeField), - FieldAccessor = field => field.Content.Value, + FieldAccessor = field => ((TimeField)field).Value, } }, { @@ -81,7 +81,7 @@ public class ContentFieldsProvider : IContentFieldProvider Description = "Multi text field", FieldType = typeof(ListGraphType), UnderlyingType = typeof(MultiTextField), - FieldAccessor = field => field.Content.Values, + FieldAccessor = field => ((MultiTextField)field).Values, } } };