public static JsonObject CreateJsonObjectWithETag()
 {
     const string valueString = "something";
     var json = new JsonObject {{"ETag", valueString}, {"id", valueString}, {"name", valueString}};
     json.EnsureValidSystemProperties();
     return json;
 }
Ejemplo n.º 2
0
 public static JsonObject CreateJsonObject(DateTime aTimestamp, string id = "something")
 {
     const string valueString = "something";
     var json = new JsonObject { { "ETag", valueString }, { "Timestamp", aTimestamp }, { "id", id }, { "name", valueString } };
     json.EnsureValidSystemProperties();
     return json;
 }
 public static JsonObject ToJsonObject(this DynamicTableEntity ce)
 {
     var json = new JsonObject { { "ETag", ce.ETag }, { "Timestamp", ce.Timestamp } };
     foreach (var field in ce.Properties)
     {
         json[field.Key] =
             IsArray(field)
                 ? InflateArray(field)
                 : field.Value.PropertyAsObject;
     }
     json.EnsureValidSystemProperties();
     return json;
 }
Ejemplo n.º 4
0
 public static JsonObject ToJsonObject(this CyanEntity ce)
 {
     var json = new JsonObject {{"ETag", ce.ETag}, {"Timestamp", ce.Timestamp}};
     foreach (var field in ce.Fields)
     {
         json[field.Key] =
             IsArray(field)
                 ? JsonConvert.DeserializeObject<object[]>(field.Value.ToString())
                 : field.Value;
     }
     json.EnsureValidSystemProperties();
     return json;
 }
Ejemplo n.º 5
0
 public static JsonObject CreateJsonObjectForPostWithArray(string id = "someId", string parentId = "", string name = "someName")
 {
     var json = new JsonObject
     {
         {"id", id},
         {"name", name},
         {"parentId", parentId},
         {"PartitionKey", "PK"},
         {"RowKey", id},
         {"dragon_ids", new object[] {"1", "2", "3"}}
     };
     json.EnsureValidSystemProperties();
     return json;
 }