Closed NotoriousPyro closed 3 years ago
In JSON, you cannot have an object that is an array.
When you inherit from a collection, you are serializing the value as an array, but RavenDB expect documents to be an object.
The later document format with the Items
is the way to go.
I have the following exception being thrown am I'm not 100% sure on the cause of it...
The code works when I implement my items as a List passed through the program but when I try to make a custom class so I can remove the List from everywhere and replace it with my class that implements IEnumerable or IList, it throws this exception.
When the object is constructed elsewhere, it looks fine but as soon as raven client tries to serialize it this exception happens...
I thought this would work and would be transformed into a list of objects but am I missing something?
The code:
The below code constructs the object fine...
When I use the below, there is no exception... however I want to avoid having to write .Items to access the list: