Currently the Add method is off of the DataCollection. Since the relationship is a single string value name, and the collection should be an enumerable it would take this:
var collection = new EntityCollection();
collection.Entities.AddRange(children);
entity.RelatedEntitites.Add(new Relationship("MyRelationshipName", collection);
And convert it to
entity.RelatedEntitites.Add("MyRelationshipName", children);
Currently the Add method is off of the DataCollection. Since the relationship is a single string value name, and the collection should be an enumerable it would take this:
And convert it to