In EntityCollectionBase:
public bool ContainsDirtyContents
{
get
{
bool doesContainDirtyEntities = false;
for(int i=0;i<List.Count;i++)
{
doesContainDirtyEntities |= ((IEntity)List[i]).Fields.IsDirty;
}
return doesContainDirtyEntities;
}
}
But how about this:
public bool ContainsDirtyContents
{
get
{
for(int i=0;i<List.Count;i++)
{
if(((IEntity)List[i]).Fields.IsDirty) return true;
}
return false;;
}
}
Or is there a big performance benifit to ORing over an if? Just imo it would be faster if theres contents changed, which in most of my stuff I would be using this, good chances are there is dirty contents. But that is just me. If this is not the case for most people, well, then I guess it will be ok, not a deal breaker, its still going to be fast anyways. I was just thinking for those cases where there are many entities.
Matt