Tuesday, August 07, 2018

Validating JSON with JSON Schema in C#

JSON Schema is a specification for validating structure-based, JSON-formatted data. JSON Schema is very similar to a grammar of some languages; it defines what data are permitted and which are not permitted. It's a vocabulary that allows developers to annotate and validate JSON documents. It ensures the quality of submitted JSON data by a client. JSON Schema also describes existing data formats in human and machine readable documentation. The JSON Schema project is currently in draft 7.0 version and will be adopted by an IETF working group.

Using SQLite in a C# Application

SQLite is a small, fast, and embeddable open source file system-based SQL database. It doesn't have a separate server component like traditional databases. Rather, it reads and writes data directly in disk files. A SQLite database is integrated with the application that accesses the database. The SQLite database file format is cross-platform and can be copied between 32-bit and 64-bit file systems. Due to the serverless architecture, developers don't need to install SQLite before using it. All SQLite transactions are fully ACID compliant; that means all queries and changes are Atomic, Consistent, Isolated, and Durable. The SQLite source code is public and is free for use for any purpose, commercial or private.

Working with MongoDB in .NET

A NoSQL database is a document-oriented database system that stores data in a JSON-like format. MongoDB is classified as a Document NoSQL databases. It's one of the most popular and leading representatives of a Document databases system widely used in the industry. MongoDB gives users the ease of use and flexibility of JSON documents with the richness of a lightweight binary format. MongoDB represents JSON documents in a binary-encoded format called BSON. Its implementation is lightweight, fast, and highly traversable.
MongoDB provides drivers that allow you to connect with MongoDB from different programming languages. In this article, I'll demonstrate MongoDB installation, how to work with MongoDB from your .NET applications (C# code), and demonstrate the CRUD functions available from the .NET driver.

Dynamically Generating QR Codes In C#

QR stands for Quick Response; it's a type of two-dimensional barcode that is used to store small amounts of text or data. It was created by the Japanese corporation Denso-Wave and aims to decode contents at high speed. Nowadays, QR Codes are used in mobile phones that can use the contents of QR Codes as a URL to open in the phone's Web browser. By using QR Codes, a developer can encode content into a QR Code image that can be saved in JPEG, GIF, PNG, or Bitmap formats. Also, by using the reverse technique, the QR decoder can decode a QR Code image. To scan a QR Code, you need to have a scanner app on your smartphone that can scan QR code.

Caching Implementation with C# Using Redis Cache

Caching is a technique for performance enhancements, especially when user interface interaction, with application speed, needs to be increased. It's also a state management strategy that helps you reduce the consumption of resources. There are several caching frameworks available, but in this article I will share information about Redis Cache, a noSQL caching technique and its integration with .NET applications. Redis keeps information as a key-value NoSQL pair.

Best Exception Handling Techniques In .NET

During application development, we have to adopt a manageable strategy for handling errors to keep the user's experience pleasant and consistent. Microsoft .NET provides a list of best practices and guidelines to follow for writing less lines of code and effectively manage error and exception handling with more a logical approach of coding and designing the code modules. In this article, we will discuss best practices of exception handling, and guide you through few effective error handling strategies that you can use in your projects.

Download SVN Code Automatically Using C#

During the development phase, developers check out and check in source code every day. Sometimes, the source code checkout task to a local repository could be automatically executed by a job. Automation of these activities will help to automate code setup in the developer's machine or the build process of an application. In this article, I will demonstrate an automated SVN checkout process from a C# console application. The Tortoise SVN command line tool uses svn.exe. This tool is helpful to pull code from an SVN server.

Playing a YouTube Video in an ASP.NET Application

Embedding Video Players using pure HTML5 video technology can enhance Web page aesthetics and overall user experience. YouTube is the most popular video sharing websites in the world. That's why, as with many popular Google services, YouTube also has a Data API. The YouTube API allows developers to interact with this service. By using this API, developers can query videos, search videos, and upload videos on YouTube.
In this article, I will demonstrates the coding technique for playing a YouTube video using an embed link. I will also demonstrate an example to consume the YouTube API to get a list of videos from a channel.

Creating a JSON File in C#

JSON (JavaScript Object Notation) is a lightweight data interchanging format. It's based on a subset of the JavaScript language. JSON is a text format and it is completely language independent. JSON is easy for humans to read and write, and it's easy for code to parse and generate. It's an alternative to XML, natively supporting basic data types. The syntax that is used in JavaScript and JSON itself stands for "JavaScript Object Notation."
JSON is built on two structures:
  • A collection of name/value pairs. In different languages, this is realized as an object, record, structure, dictionary, hash table, keyed list, or associative array.
  • An ordered list of values. In most languages, JSON is realized as an array, vector, list, or sequence.

Mocking API Responses in Azure API Management Portal

A mock API imitates a real API call by providing a realistic JSON or XML response to the requester. Mock APIs can be designed on a developer...