Skip to content

Commit

Permalink
Use static typing in ContentFieldsProvider instead of dynamic. (#15763)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvkries authored Apr 15, 2024
1 parent b406d50 commit 03c6cba
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
},
{
Expand All @@ -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,
}
},
{
Expand All @@ -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,
}
},
{
Expand All @@ -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,
}
},
{
Expand All @@ -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,
}
},
{
Expand All @@ -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,
}
},
{
Expand All @@ -81,7 +81,7 @@ public class ContentFieldsProvider : IContentFieldProvider
Description = "Multi text field",
FieldType = typeof(ListGraphType<StringGraphType>),
UnderlyingType = typeof(MultiTextField),
FieldAccessor = field => field.Content.Values,
FieldAccessor = field => ((MultiTextField)field).Values,
}
}
};
Expand Down

0 comments on commit 03c6cba

Please sign in to comment.