Consider this Representation and corresponding SimpleListRepresentation:
public class ItemRepresentation : Representation {}
public class ItemListRepresentation : SimpleListRepresentation<ItemRepresentation>
{
public ItemListRepresentation() { }
public ItemListRepresentation(IList<ItemRepresentation> list) : base(list) { }
}
If an ItemListRepresentation contains an ItemRepresentation without Href property set, then RepopulateHyperMedia() on ItemRepresentation will set Links to null, which will cause an ArgumentNullException to be thrown by ToLink(IHypermediaResolver resolver).
Should a more informative exception be thrown somewhere to handle this case?
Consider this
Representation
and correspondingSimpleListRepresentation
:If an
ItemListRepresentation
contains anItemRepresentation
withoutHref
property set, thenRepopulateHyperMedia()
onItemRepresentation
will setLinks
to null, which will cause anArgumentNullException
to be thrown byToLink(IHypermediaResolver resolver)
.Should a more informative exception be thrown somewhere to handle this case?