JSon数据操作示列

var orderparametersJson = JsonConvert.SerializeObject(parameters.OrderParameters);
    /// <summary>
        /// 类目列表
        /// </summary>
        static Lazy<IList<ProductCategory>> Categories { get; }
        = new Lazy<IList<ProductCategory>>(() => {
            var pathManager = CompositionManager.GetValue<IPathManager>();
            var path = pathManager.GetPluginResourcePath(
                "ZKShop.Product", "Json", "categories.json");
            var json = File.ReadAllText(path);
            return JsonConvert.DeserializeObject<IList<ProductCategory>>(json);
        });

 

posted @ 2015-09-27 16:45  中酷科技ZKWeb博客  阅读(167)  评论(0编辑  收藏  举报