The exception indicates that you adding same key twice to your dictionary, to solve this issue you can start by insuring that the DataModelCollection objects which passed to the function has unique Key values (which in your case is a Guid data type) dmo.Guid