I have a solution that contains a WCF Project and a Project for Data Classes, each class is owned as a "DT" class. Each of these DT classes are marked as a DataContract() with each property labeled as a DataMember().
[DataContract()]
public class AttachmentDT : IAttachment
{
private System.Int32 mAttachmentID;
[DataMember()]
public System.Int32 AttachmentID
{
get { return mAttachmentID; }
set { mAttachmentID = value; }
}
private System.DateTime mCreateDate;
[DataMember()]
public System.DateTime CreateDate
{
get { return mCreateDate; }
set { mCreateDate = value; }
}
private System.Byte[] mFileBytes;
[DataMember()]
public System.Byte[] FileBytes
{
get { return mFileBytes; }
set { mFileBytes = value; }
}
private System.String mFileName;
[DataMember()]
public string FileName
{
get { return mFileName; }
set { mFileName = value; }
}
}
My WCF project has a class reference to the data classes project so i have access to these classes. If i do not use any of them in the WCF interface, the client application that uses the WCF cannot see the data classes either. Why is this? Must i seriously have to create an empty method for each data class that i want the client to see? For example in my WCF interface, i create a useless method...
[OperationContract()]
void AttachmentDT(AttachmentDT a) { }
If i have 20 data classes i want to give visibility too, i have to do this stupid crap for each? Please tell me there is a less ignorant way to get visibility to these DT classes.