Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.

Public Report
Report From: Delphi Prism/Suggestion    [ Add a report in this area ]  
Report #:  89294   Status: Open
Change how nullable Guid is handled in Silverlight WCF Service
Project:  Embarcadero Prism Build #:  4.0.25.791
Version:    1.1 Submitted By:   Mark Tiede
Report Type:  Minor failure / Design problem Date Reported:  10/28/2010 4:40:52 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   281199
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
A DataContract DataMember element that is defined as a nullable Guid is translated to nullable<Guid> when Silverlight Client Service Interface is generated.

This ends up making the property unable to be assigned a nil in the client.  This causes a problem when the Guid is sent back to the service.

The nullable Guid can be of 3 states:

1. nil
2. Empty
3. a Guid value

The nullable<Guid> can only be in 2 states (as far as I can determine):

1. Empty
2. a Guid value

So I can't even get a nil Guid down from the service and then update it back to its original value.
Steps to Reproduce:
1. Declare a DataContract with a DataMember of nil.
2. Make Service method interface and implementation to fetch the DataContract and another to send the same object back up to the Service.
3. In the implementation, set the DataMember to nil.
4.Generate SilverLight client interface.
5. Make a SilverLight client call to fetch the data.
6. Make a SilverLight client call to send the data back up to the Service.
7. Inspect the nullable Guid and see that it is not nil.
Workarounds
None
Attachment
None
Comments

Mark Tiede at 10/28/2010 6:41:45 AM -
Please CLOSE this report.  I was mistaken.  The debugger showed conflicting information.  Also, when I set the IsNullable property on the Parameter to the query, it worked fine.

Mark Tiede at 10/28/2010 6:41:49 AM -
Please CLOSE this report.  I was mistaken.  The debugger showed conflicting information.  Also, when I set the IsNullable property on the Parameter to the query, it worked fine.

Mark Tiede at 10/28/2010 6:43:15 AM -
And I think the Nullable<Guid> DOES have the 3 states when the HasValue property is taken into account.

Server Response from: ETNACODE01