Skip to content

Commit c2873fd

Browse files
committed
Implemented pattern matching for readability
1 parent 8a522ab commit c2873fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

OnTopic.Editor.AspNetCore/Controllers/EditorController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ private ContentTypeDescriptor GetContentType(string contentType) => TopicReposit
122122
/// <param name="modelType"></param>
123123
/// <returns></returns>
124124
private ModelType GetModelType(ModelType modelType) {
125-
if (modelType == ModelType.Reflexive && CurrentTopic is AttributeDescriptor) {
126-
return ((AttributeDescriptor)CurrentTopic).ModelType;
125+
if (modelType == ModelType.Reflexive && CurrentTopic is AttributeDescriptor attributeDescriptor) {
126+
return attributeDescriptor.ModelType;
127127
}
128128
return modelType;
129129
}

0 commit comments

Comments
 (0)