EdisonCP / sharp-architecture

Automatically exported from code.google.com/p/sharp-architecture
Other
0 stars 0 forks source link

Model Binder fails with Collections with IDs defined as GUIDs #122

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Having an entity A with a collection of other entities B
2. B primary key is a GUID
3. Try to save.

What is the expected output? What do you see instead?
Save should work. I see an exception about trying to Convert a String to a Guid

What version of the product are you using? On what operating system?
Latest.

Please provide any additional information below.
In order to fix it, change EntityCollectionValueProviderResult, line 50 from:
               object typedId = Convert.ChangeType(rawId, idType);

to:
                object typedId =
                    (idType == typeof(Guid))
                        ? new Guid(rawId)
                        : Convert.ChangeType(rawId, idType);

Original issue reported on code.google.com by cur...@gmail.com on 1 Sep 2009 at 11:02

GoogleCodeExporter commented 8 years ago

Original comment by wmccaffe...@gmail.com on 30 Sep 2009 at 9:29

GoogleCodeExporter commented 8 years ago
Thanks for the fix...this will be in the Q3 release.

Original comment by wmccaffe...@gmail.com on 29 Oct 2009 at 9:10