Skip to content

See if we can not use IEnumerable for Multivalue properties. #3

@rsleggett

Description

@rsleggett

Multivalue fields must be of type IEnumerable for example:

[EmbeddedValues("slides", typeof(HomepageCarouselSlideViewModel), IsMultiValue = true)]
public IEnumerable Slides { get; set; }

This is bad because IEnumerables cannot be reliably updated so code like

foreach(var slide in model.Slides)
{
slide.SomeProp = "somevalue";
}

The value of SomeProp could not be guarenteed to be set on the next enumeration.

Current workaround is to enumerate with ToList and then set this back to the property

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions