Skip to content

Commit 03c6cba

Browse files
authored
Use static typing in ContentFieldsProvider instead of dynamic. (#15763)
1 parent b406d50 commit 03c6cba

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/OrchardCore.Modules/OrchardCore.ContentFields/GraphQL/Fields/ContentFieldsProvider.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ContentFieldsProvider : IContentFieldProvider
2121
Description = "Boolean field",
2222
FieldType = typeof(BooleanGraphType),
2323
UnderlyingType = typeof(BooleanField),
24-
FieldAccessor = field => field.Content.Value,
24+
FieldAccessor = field => ((BooleanField)field).Value,
2525
}
2626
},
2727
{
@@ -31,7 +31,7 @@ public class ContentFieldsProvider : IContentFieldProvider
3131
Description = "Date field",
3232
FieldType = typeof(DateGraphType),
3333
UnderlyingType = typeof(DateField),
34-
FieldAccessor = field => field.Content.Value,
34+
FieldAccessor = field => ((DateField)field).Value,
3535
}
3636
},
3737
{
@@ -41,7 +41,7 @@ public class ContentFieldsProvider : IContentFieldProvider
4141
Description = "Date & time field",
4242
FieldType = typeof(DateTimeGraphType),
4343
UnderlyingType = typeof(DateTimeField),
44-
FieldAccessor = field => field.Content.Value,
44+
FieldAccessor = field => ((DateTimeField)field).Value,
4545
}
4646
},
4747
{
@@ -51,7 +51,7 @@ public class ContentFieldsProvider : IContentFieldProvider
5151
Description = "Numeric field",
5252
FieldType = typeof(DecimalGraphType),
5353
UnderlyingType = typeof(NumericField),
54-
FieldAccessor = field => field.Content.Value,
54+
FieldAccessor = field => ((NumericField)field).Value,
5555
}
5656
},
5757
{
@@ -61,7 +61,7 @@ public class ContentFieldsProvider : IContentFieldProvider
6161
Description = "Text field",
6262
FieldType = typeof(StringGraphType),
6363
UnderlyingType = typeof(TextField),
64-
FieldAccessor = field => field.Content.Text,
64+
FieldAccessor = field => ((TextField)field).Text,
6565
}
6666
},
6767
{
@@ -71,7 +71,7 @@ public class ContentFieldsProvider : IContentFieldProvider
7171
Description = "Time field",
7272
FieldType = typeof(TimeSpanGraphType),
7373
UnderlyingType = typeof(TimeField),
74-
FieldAccessor = field => field.Content.Value,
74+
FieldAccessor = field => ((TimeField)field).Value,
7575
}
7676
},
7777
{
@@ -81,7 +81,7 @@ public class ContentFieldsProvider : IContentFieldProvider
8181
Description = "Multi text field",
8282
FieldType = typeof(ListGraphType<StringGraphType>),
8383
UnderlyingType = typeof(MultiTextField),
84-
FieldAccessor = field => field.Content.Values,
84+
FieldAccessor = field => ((MultiTextField)field).Values,
8585
}
8686
}
8787
};

0 commit comments

Comments
 (0)