Click here to Skip to main content
15,442,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created this in data contract
but when i create client proxy it give only one class ie StandardClass
can any one please i want both class

is their way i have created Business entity class that class i want in client proxy without adding
[DataContract] and [DataMember]
C#
 [DataContract]
 public class StandardClass
    {
        [DataMember]
        public int Std_Id;
        [DataMember]
        public string Std_Name;

    }
    [DataContract]
    public class QuestionEntityClass
    {
        [DataMember]
        public int Quest_Id;
        [DataMember]
        public int? Std_Id;
        [DataMember]
        public string Question;
        [DataMember]
        public string Optn1;
        [DataMember]
        public string Optn2;
        [DataMember]
        public string Optn3;
        [DataMember]
        public string Optn4;
        [DataMember]
        public string Ans;

    }

My Bussiness_Entity.cs

  [Serializable]
    public class Edulight_Entity
    {
   [Serializable]
        public class Standard : Edulight_Entity
        {
            public int Std_Id { get; set; }
            public string Std_Name { get; set; }

        }
        [Serializable]
        public class QuestionEntity : Edulight_Entity
        {
            public int Quest_Id { get; set; }
            public int? Std_Id { get; set; }
            public string Question { get; set; }
            public string Optn1 { get; set; }
            public string Optn2 { get; set; }
            public string Optn3 { get; set; }
            public string Optn4 { get; set; }
            public string Ans { get; set; }

        }
}
Posted
Updated 29-Dec-13 19:14pm
v2
Comments
Sergey Alexandrovich Kryukov 30-Dec-13 2:28am     CRLF
Not enough information. You data contract types are fine (way too simple, maybe). Why all is public? It may be too much access (but not related to your problem). Why would you use Serializable? Data contract does not need it... You problem might be elsewhere... —SA
Member-515487 30-Dec-13 2:40am    
Serializable i have use because i am storing data in viewstate for further use

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900