Wcf HTTP resultCode,结果和json格式的消息

时间:2014-02-17 15:18:36

标签: c# json wcf

在Wcf中,我以该格式获取数据

[{"status":{"message":"Login Successfull","result":1,"resultCode":200},"user":{"regId":6,"sessionId":"184b9524-abd1-4698-866a-f87c3270d44f","type":"S"}}]

but i want it in 
{"resultCode": 200,"message": "Login Successfull","result":,"user":{"sessionId":"CXNBVN543453VBNV654V4234G2F4V23423BN423NB24V2FSFDSDF6SFS6FSFBVNN","type":"parent","regId":""}}

我正在使用这些课程

[DataContract]
    public class LoginValidation
    {
        [DataMember]
        public string sessionId { get; set; }
        [DataMember]
        public string type { get; set; }
        [DataMember]
        public int regId { get; set; }

    }

[DataContract]
    public class ResultStatus
    {
        [DataMember]
        public int resultCode { get; set; }
        [DataMember]
        public string message { get; set; }
        [DataMember]
        public int result { get; set; }
    }


    public class LoginStatus
    {
        [DataMember]
        public ResultStatus status { get; set; }
        [DataMember]
        public LoginValidation user { get; set; }
    } 

我如何以该格式获取数据

0 个答案:

没有答案