Example #1
0
        public static IDictionary <string, object> FullEncode(this AVObject obj)
        {
            var objectJSON = obj.Encode();

            if (obj.CreatedAt.HasValue)
            {
                objectJSON["createdAt"] = obj.CreatedAt.Value.ToString(DateFormatStrings.First(),
                                                                       CultureInfo.InvariantCulture);
            }
            if (obj.UpdatedAt.HasValue)
            {
                objectJSON["updatedAt"] = obj.UpdatedAt.Value.ToString(DateFormatStrings.First(),
                                                                       CultureInfo.InvariantCulture);
            }
            objectJSON["className"] = obj.ClassName;
            if (!string.IsNullOrEmpty(obj.ObjectId))
            {
                objectJSON["objectId"] = obj.ObjectId;
            }
            objectJSON["__type"] = "Object";
            return(objectJSON);
        }