diff --git a/Lombiq.HelpfulLibraries.OrchardCore/Contents/JsonSectionDisplayDriver.cs b/Lombiq.HelpfulLibraries.OrchardCore/Contents/JsonSectionDisplayDriver.cs index 1e81d4c1..3169a880 100644 --- a/Lombiq.HelpfulLibraries.OrchardCore/Contents/JsonSectionDisplayDriver.cs +++ b/Lombiq.HelpfulLibraries.OrchardCore/Contents/JsonSectionDisplayDriver.cs @@ -45,11 +45,7 @@ await AuthorizeAsync() public override async Task UpdateAsync(TSection section, UpdateEditorContext context) { - var viewModel = new JsonViewModel(); - - if (context.GroupId == GroupId && - await AuthorizeAsync() && - await context.Updater.TryUpdateModelAsync(viewModel, Prefix) && + if (await context.CreateModelMaybeAsync>(Prefix, GroupId, AuthorizeAsync) is { } viewModel && TryParseJson(viewModel.Json, out var result)) { await UpdateAsync(section, context, result);