• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
Show / Hide Table of Contents

JSON Data Types and Properties Overview [Deprecated]

JSON is a human-readable lightweight syntax for sharing data. It is structured and formatted for machines to parse effortlessly and for data exchange to occur conveniently and seamlessly. JSON has the JsonObject (an unordered name/value pair as attributes) as a basic structure.

Note

This feature is also available in NCache Professional.

Additionally, using JSON requires JSON serialization and it is most commonly used when dealing with multilingual applications or applications that interact with numerous documents. If you have a complete object, you can use a NewtonSoft Serializer to procure a JSON string and add it as an object (which you can read more about in our Administrators' Guide). Alternatively, NCache provides an API to construct a JSON object. NCache lets you add data that represents JSON into your cache. However, if you are dealing with documents, as we've discussed previously, you can add the documents to the cache directly.

NCache allows users the flexibility of retrieving any custom class data in your cache as JSON data. Moreover, data can be added as JSON data and fetched as a custom class, provided that the attributes represent the properties of the custom class. Data being JSON serialized, when retrieved by the user as JSON, is parsed by NCache and provided to you as either of the following according to your requirement:

  • JsonObject
  • JsonNull

These classes are derived from an abstract class called JsonValueBase.

Consider a .NET class Product containing data of products. When added with the JsonObject, the class attributes, e.g., ProductName and ProductID, etc., will be the attributes of the JsonObject. Given below is the data of a .NET class containing the following properties:

Product product = new Product();
product.ProductID = 1001;
product.ProductName = "Chai";
product.Category = "Beverages";

The JSON equivalent of the given data when added as JsonObject will be a string containing all the attributes and is displayed as follows:

{
    "ProductID" : 1001,
    "ProductName" : "Chai",
    "Category" : "Beverages"
}

Moreover, you can provide a string containing JSON data and parse it to get JsonValueBase in return. It will parse this string and identify the data type.

JSON Data Classes in NCache

Let us get a closer look at all these classes provided by NCache.

JsonObject

This class represents JObject in JSON standards in NCache’s domain. Just as a JObject contains name/value pairs (referring to the attribute). This class also contains the string and JsonValueBase key-value pairs.

JsonNull

This class represents a null value in JSON standards. It also maps null values in NCache’s domain to null values in JSON standards.

The JsonObject can be added with a CacheItem in the cache. The CacheItem is a class that represents a cached item, including its various properties. The CacheItem can provide JsonObject with many functionalities, such as:

  • Cache Dependencies (Enterprise only)
  • Tags (Enterprise only)
  • NamedTags (Enterprise only)
  • Groups (Enterprise only)
  • Expiration

Various operations performed on the cache using the classes mentioned above are explained in the successive chapters.

See Also

Using JsonObject in Cache
Cache Serialization Format

In This Article
  • JSON Data Classes in NCache
    • JsonObject
    • JsonNull
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top