public ExtraGifParam ParseFromJsonString(string jsonStr) { ExtraGifParamInternal jsonObj = JsonMapper.ToObject <ExtraGifParamInternal>(jsonStr); this.Extra = jsonObj.extra; this.Level = int.Parse(jsonObj.level); this.VipLevel = int.Parse(jsonObj.vip_level); this.Location = jsonObj.location; this.NickName = jsonObj.nickname; this.Score = int.Parse(jsonObj.score); this.ServerArea = jsonObj.server_area; return(this); }
public string ToJsonString() { ExtraGifParamInternal jsonObj = new ExtraGifParamInternal(); jsonObj.extra = this.Extra; jsonObj.level = this.Level.ToString(); jsonObj.vip_level = this.VipLevel.ToString(); jsonObj.location = this.Location; jsonObj.nickname = this.NickName; jsonObj.score = this.Score.ToString(); jsonObj.server_area = this.ServerArea; return(JsonMapper.ToJson(jsonObj)); }