That's not going to work, even if you put it the other way round:
parent.AddRange(child.Except(parent)).ToList();
Why not? Because
Template a = new Template(){ID="1"};
Template b = new Template(){ID="1"};
Does not create one instance - it creates two different instances
that have the same ID.The comparison for "are these the same?" compares the references, not the content, unless Template is a struct, so
a
and
b
are different!
You would need to use the other form of Except:
http://msdn.microsoft.com/en-us/library/vstudio/bb336390(v=vs.90).aspx[
^] which accepts a custom comparer to decide on equality (and swap child / parent over as well)