none
Constructor Webservice Data contract

    Question

  • I want to create a web service data contract that accepts a CustomerID as  a string or as an Int Using the same user class? Is this possible? 

        // Data contract representing a User - a User corresponds to a unique Customer
        [DataContract]
        public class User
        {
            // Properties of a User
            [DataMember]
            public string UserID { get; set; }
            [DataMember]
            public string CustomerID { get; set; }
            [DataMember]
            public string UserName { get; set; }
            [DataMember]
            public string Email { get; set; }
            [DataMember]
            public string QMemberID { get; set; }
            [DataMember]
            public string HeathSuiteID { get; set; }
            [DataMember]
            public string loginType { get; set; }
        }

        public class User
        {
            // Properties of a User
            [DataMember]
            public string UserID { get; set; }
            [DataMember]
            public int CustomerID { get; set; }
            [DataMember]
            public string UserName { get; set; }
            [DataMember]
            public string Email { get; set; }
            [DataMember]
            public string QMemberID { get; set; }
            [DataMember]
            public string HeathSuiteID { get; set; }
            [DataMember]
            public string loginType { get; set; }
        }

    Tuesday, July 23, 2013 5:41 PM