This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm passing the Lightspeed generated DTOs down to a Silverlight client using .NET RIA Services. I've spent the last two days fighting a bug where I couldn't upload anything from Silverlight back to the client. For all the gorry details see: Anyway, the basic problem is that the DataContract attribute has a name that is not the same as the name of the class: [System.Runtime.Serialization.DataContract(Name="Contact")] On the automatically generated DataModelDtoBase base class the data contract name is the same as the class name, but on any other DTO class that is actually mapping to a persistable entity the data contract name is the name of the original entity (without the "Dto" appended to the class name). This completely breaks .NET RIA Services, and renders the entire DTO experience useless because I can't use them to transfer data back and forth. Now, this may be perfectly valid from a WCF perspective (unfortunately I don't know WCF) but I need a solution to the problem. :-) My questions therefore are:
In other words, please help! :-) Thanks, Robert |
|
|
Yes, this is valid WCF, and although LightSpeed doesn't use the name for anything, proxy generators do. We will be looking at RIA Services post-3.0 and will aim to offer some sort of more systemic resolution then -- at the moment we don't have any experience of RIA Services so we'd be fixing things blind if we tried to plaster over the problem without that holistic view. (Yes, today is Mixed Metaphor day in New Zealand.) I don't want to just turn off the name, and I don't want to complicate the designer by adding additional options until I know what our end-to-end solution is for RIA Services. In the meantime, you can work around this by customising the templates to remove the (Name=...) bit. For info about how to do this see http://www.mindscape.co.nz/blog/index.php/2009/09/16/customising-lightspeed-entity-templates/. It's a bit of a sledgehammer solution I realise but I think it's probably the best option for now. Let us know if you need any more info or assistance to get this working. |
|
|
Good enough, thanks Ivan! :-) (and I can certainly respect your desire to implement the right solution later; who knows, maybe by then this bug will be fixed in .NET RIA Services). |
|