-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extensions for IDisplayManager (#14579)
- Loading branch information
1 parent
829706d
commit ea9dff3
Showing
6 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/OrchardCore/OrchardCore.DisplayManagement/Extensions/DisplayManagerExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading.Tasks; | ||
using OrchardCore.DisplayManagement.ModelBinding; | ||
|
||
namespace OrchardCore.DisplayManagement; | ||
|
||
public static class DisplayManagerExtensions | ||
{ | ||
public static Task<IShape> BuildDisplayAsync<TModel>(this IDisplayManager<TModel> displayManager, IUpdateModel updater, string displayType = "", string groupId = "") where TModel : new() | ||
=> displayManager.BuildDisplayAsync(new TModel(), updater, displayType, groupId); | ||
|
||
public static Task<IShape> BuildEditorAsync<TModel>(this IDisplayManager<TModel> displayManager, IUpdateModel updater, bool isNew, string groupId = "", string htmlPrefix = "") where TModel : new() | ||
=> displayManager.BuildEditorAsync(new TModel(), updater, isNew, groupId, htmlPrefix); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters