Beispiel #1
0
 public string this[string key]
 {
     get
     {
         if (!ParamDictionary.ContainsKey(key))
         {
             return(string.Empty);
         }
         return(ParamDictionary[key]);
     }
 }
        private ParamDictionary SerializeBizModel <T>(ParamDictionary requestParams, IRequest <T> request) where T : IResponse
        {
            ParamDictionary result            = requestParams;
            Boolean         isBizContentEmpty = !requestParams.ContainsKey(BIZ_CONTENT) || string.IsNullOrEmpty(requestParams[BIZ_CONTENT]);

            if (isBizContentEmpty && request.GetBizModel() != null)
            {
                IObject bizModel = request.GetBizModel();
                string  content  = Newtonsoft.Json.JsonConvert.SerializeObject(bizModel);
                result.Add(BIZ_CONTENT, content);
            }
            return(result);
        }