Installed NuGet package "BeginCollectionItem"

Used that package instead of writing my own class.