Esempio n. 1
0
        public static LogRecord <T> NewAzureDiagnosticLogRecord <T>(Newtonsoft.Json.Linq.JObject jo_record)
        {
            var o = new LogRecord <T>();

            o.Time            = jo_record.GetDateTimeOffset("time");
            o.ResourceId      = jo_record["resourceId"].ToString();
            o.Category        = jo_record["category"].ToString();
            o.OperationName   = jo_record["operationName"].ToString();
            o.ResultType      = jo_record.GetString("resultType", null);
            o.ResultSignature = jo_record.GetString("resultSignature", null);
            o.CorrelationId   = jo_record.GetString("correlationId", null);
            o.Identity        = jo_record["identity"].ToString();

            return(o);
        }
Esempio n. 2
0
        public static System.DateTimeOffset?GetDateTimeOffsetNullable(this Newtonsoft.Json.Linq.JObject jo, string name)
        {
            string s = jo.GetString(name, null);

            if (s != null)
            {
                if (string.IsNullOrWhiteSpace(s))
                {
                    return(null);
                }

                return(System.DateTimeOffset.Parse(s));
            }
            return(null);
        }
Esempio n. 3
0
        public static System.DateTimeOffset GetDateTimeOffset(this Newtonsoft.Json.Linq.JObject jo, string name)
        {
            string s = jo.GetString(name, null);

            return(System.DateTimeOffset.Parse(s));
        }