when i build mapping builder using IMappingBuilderAdapter<>.Build() it throws error like:

System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Xtensive.ObjectMapping.MappingBuilder.BindToSource(TargetTypeDescription targetType, TargetPropertyDescription property) in c:\Work\DataObjects.Net\4.4\Xtensive.Core\Xtensive.Core\ObjectMapping\MappingBuilder.cs:line 251
   at Xtensive.ObjectMapping.MappingBuilder.BuildTargetPropertyDescriptions(TargetTypeDescription targetType) in c:\Work\DataObjects.Net\4.4\Xtensive.Core\Xtensive.Core\ObjectMapping\MappingBuilder.cs:line 239
   at Xtensive.ObjectMapping.MappingBuilder.BuildTargetDescriptions() in c:\Work\DataObjects.Net\4.4\Xtensive.Core\Xtensive.Core\ObjectMapping\MappingBuilder.cs:line 217
   at Xtensive.ObjectMapping.MappingBuilder.Build() in c:\Work\DataObjects.Net\4.4\Xtensive.Core\Xtensive.Core\ObjectMapping\MappingBuilder.cs:line 128

It is hard to find whats wrong with mapping. Later i found (thanks to access to DO4 repository :-)) that i have property "XYZ" in real entity class but does not have such property in DTO class and this is an reason why its fails. Could you add some check for missing mapping of properties and throw your own exception with detailed error which property missing on which type?

Update: v4.4 Build number 7589

asked Jun 10 '11 at 08:52

Peter%20%C5%A0ulek's gravatar image

Peter Ĺ ulek
492313236

edited Jun 10 '11 at 08:55

Thanks, Peter.

Will do.

(Jun 14 '11 at 07:15) Dmitri Maximov Dmitri%20Maximov's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×568
×23
×11
×6

Asked: Jun 10 '11 at 08:52

Seen: 1,276 times

Last updated: Jun 14 '11 at 07:15

powered by OSQA