コード例 #1
0
ファイル: JsonContract.cs プロジェクト: lidoudou1992/apowo
    public static JsonContract GetJsonContractByType(Type type)
    {
        JsonContract jct = null;

        if (JsonContractCache.ContainsKey(type))
        {
            jct = JsonContractCache [type];
        }
        else
        {
            //DateTime dt = DateTime.Now;
            jct = new JsonContract(type);
            jct.InitialDefault();
            JsonContractCache [type] = jct;
            //var cost = (int)(DateTime.Now - dt).TotalMilliseconds;
            //Logger.GetLogFile ("性能").WriteLog ("GetJsonContractByType[{0}][{1}]耗时[{2}]", type.Name, jct.Properties.Count (), cost);
        }
        return(jct);
    }