Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Known types - LI element limited to multiple types with at least 1 item #161

Open
Sevitas opened this issue Sep 8, 2022 · 0 comments
Open

Comments

@Sevitas
Copy link
Contributor

Sevitas commented Sep 8, 2022

Motivation

Solves scenario 4 of issue #90 scenarios
Linked items element limited to multiple types with at least 1 item.

Proposed solution

Article.Generated.cs will contain

public IEnumerable<IContentItem> Sections { get; set; }

Article.Typed.Generated.cs will contain

public IEnumerable<Banner> SectionsBannerTyped => Sections.OfType<Banner>();
public IEnumerable<CompanyNews> SectionsCompanyNewsTyped => Sections.OfType<CompanyNews>();

Additional context

As a developer, you still need to check which properties contain any items. Some properties might be empty.
Take in mind responses and notes in the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant