Hi everyone!
I have the following code:
EntityCollection eventInstances = new EntityCollection(new EventEntityFactory());
...
foreach (DateTime dt in dc)
{
EventEntity eventInstance = foundEvent;
eventInstance.StartDate = dt;
eventInstances.Add(eventInstance);
}
How can I get the eventInstance that I add to be unique in the eventInstances collection?
I've been around and around with a couple different options. I can either get only 1 instance in the list, or 6 copies of the same event. At first, I assumed EventID had to be unique so I fudged it for a test, but that didn't work. Then I went a couple of iterations with: eventInstances.DoNotPerformAddIfPresent = false; but that didn't work either (got multiples in the list though!). Then I ran across eventInstance.ObjectID and assumed it had to be unique but didn't have any luck there either. Even tried making a new instance with EventEntity(foundEvent.Fields) with no luck.
I'm starting to think that it is coming back to the reference type/value type concept that I had so much fun with not too long ago. If so, how can I get unique events into my collection?
Thanks,
Matt