You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public List<Picture> Pictures { get; private set; }
which is initialized in the following constructor:
public ClassifiedAd(ClassifiedAdId id, UserId ownerId)
{
Pictures = new List<Picture>();
Apply(
new Events.ClassifiedAdCreated
{
Id = id,
OwnerId = ownerId
}
);
}
That's working fine but not in the re-hydrate scenario because the aggregate root doesn't touch that constructor when the event sourcing machinery is setting up via reflection the aggregate root.
A potential fix is to initialize the collection directly as follows:
public List<Picture> Pictures { get; private set; } = new List<Picture>();
The text was updated successfully, but these errors were encountered:
The ClassifiedAdd class has:
which is initialized in the following constructor:
That's working fine but not in the re-hydrate scenario because the aggregate root doesn't touch that constructor when the event sourcing machinery is setting up via reflection the aggregate root.
A potential fix is to initialize the collection directly as follows:
The text was updated successfully, but these errors were encountered: