Vibrant discussion about CSLA .NET and using the framework to build great business applications.
Hi, firts of all sorry for my not so good english, i'm using Csla 3.0.5, my Dataportal is WcfProxy, when i reatreave an object with SqlGuid field and that field is Null from the database i get this exception:
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ws.lhotka.net/WcfDataPortal:FetchResult. The InnerException message was 'ValueType 'System.Data.SqlTypes.SqlGuid' cannot be null.'. Please see InnerException for more details.
I googled for a coupled of hours and for my surprise i didnt find nothing about this particular issue, can anybody help me on this?
SqlGuid is not a data type that your BO should use.
Convert it to a System.Guid or a string instead.
Jonny Bekkum, Norway
Hi Jonny, Thans for your quick response; i'm afraid that is something that i cannot change because this is a big legacy application and the code of the those BOs librarys is not on my control. But the instersting thing is when the database column is not null everything works fine. Any idea?
Probably because this code (I use LinqPad to run code):
var x = new System.Data.SqlTypes.SqlGuid((string)null);x.Dump();
will throw exception
mscorlib, Version=184.108.40.206, Culture=neutral,
PrivateScope, Public, HideBySig, SpecialName, RTSpecialName
Thanks very much Jonny, i switched to WebService DataPortal which accept SqlGui nulls value from db.
I tested WCF with System.Guid and works fine, but we cannot move our code to use guid, so the service will do the work in the meadel time