-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto Element deserialization and refactor web sample
- Loading branch information
Showing
20 changed files
with
127 additions
and
227 deletions.
There are no files selected for viewing
72 changes: 0 additions & 72 deletions
72
...adless.Client.Samples.Web/Umbraco.Headless.Client.Samples.Web/Models/ContentExtensions.cs
This file was deleted.
Oops, something went wrong.
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
5 changes: 3 additions & 2 deletions
5
...co.Headless.Client.Samples.Web/Umbraco.Headless.Client.Samples.Web/Models/TextAndImage.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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
using Microsoft.AspNetCore.Html; | ||
using Newtonsoft.Json; | ||
using Umbraco.Headless.Client.Net.Delivery.Models; | ||
using Umbraco.Headless.Client.Samples.Web.Serialization; | ||
|
||
namespace Umbraco.Headless.Client.Samples.Web.Models | ||
{ | ||
public class TextAndImage | ||
public class TextAndImage : Element | ||
{ | ||
public string Title { get; set; } | ||
|
||
[JsonConverter(typeof(HtmlContentConverter))] | ||
public IHtmlContent Text { get; set; } | ||
public string ImageUrl { get; set; } | ||
public Image Image { get; set; } | ||
public bool ShowLargeImage { get; set; } | ||
} | ||
} |
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
22 changes: 0 additions & 22 deletions
22
...mples.Web/Umbraco.Headless.Client.Samples.Web/ViewComponents/TextAndImageViewComponent.cs
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
...eb/Umbraco.Headless.Client.Samples.Web/ViewComponents/UniqueSellingPointsViewComponent.cs
This file was deleted.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
...less.Client.Samples.Web/Umbraco.Headless.Client.Samples.Web/Views/Shared/_Elements.cshtml
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
@model IEnumerable<Umbraco.Headless.Client.Net.Delivery.Models.Element> | ||
@model IEnumerable<Umbraco.Headless.Client.Net.Delivery.Models.IElement> | ||
|
||
@foreach (var element in Model) | ||
{ | ||
@await Component.InvokeAsync(element.ContentTypeAlias, new { element }) | ||
await Html.RenderPartialAsync($"Elements/_{element.ContentTypeAlias}", element); | ||
} |
File renamed without changes.
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
21 changes: 14 additions & 7 deletions
21
src/Umbraco.Headless.Client.Net/Configuration/HeadlessConfigurationExtensions.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
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
Oops, something went wrong.