DataContract and C# naming standards

Sep 12, 2010 at 11:07 AM

There are times, when most of the service providers already provides an xsd file like facebook. http://api.facebook.com/1.0/facebook.xsd

sample from the facebook.xsd

<xsd:complexType name="comments_info"> 
 <xsd:sequence>
   <xsd:element name="app_id" type="xsd:long" />
   <xsd:element name="xid" type="xid" />
   <xsd:element name="updated_time" type="time" />
   <xsd:element name="count" type="xsd:int" />
 </xsd:sequence>
</xsd:complexType>

the problem is when xsd2code generates the class name it generates as follows

public partial class comments_info {
    public long app_id {get;set;}
}

is it possible to rather generate it in C# naming standards and use DataContract and DataMember attributes.

[DataContract(Name="comments_info")]
public partial class CommentsInfo{
   [DataMember(Name="app_id")] 
   public log AppID {get;set;}
}