How to expose data in my WCF Service

Sgzdgrbt

New Member
This is somewhat of a silly question.But...I am exposing a service of Street locations. What I have been doing so far is getting my data using Entity Framework and parsing the data into XML using XElement. Then in my service layer, I am returning the XElement to be exposed in my service.Is this the proper way of exposing data? Since WCF is using the Data Contract which in turn serializes to XML anyway, is it a bad practice to convert it myself to XML?I can also return a List to accomplish the same thing. However, this means I have no control on how the XML would look...What best practice can I follow and where can I read some good info on best practices. Ive been searching in this site but there are a lot of different topics when it comes to best practice. Thanks
 
Back
Top