Category: C#

Json.NET & C# – How to Seralize an Object ?

One of the ways to serialize an object to JSON string in C# in the Json.NET is using the SerializeObject method defined in the JsonConvert method. The JsonConvert class provides an easy to use wrapper class and method over the JsonSerializer. How to Seralize an Object in C# using Json.NET ? Below is the sample code snippet demonstrating the usage of JsonConvert.SerializeObject method in C#…

Example of Anonymous methods in C#

Anonymous methods in C# are like regular methods nut does not contain any name. Anonymous methods are just like regular methods  and uses the delegate keyword and does not need a name , parameter or return type. Example of Anonymous methods in C# Below is a sample code snippet demonstrating the usage of the anonymous types in C#

How to Convert a Number to Bytes Array in C# ?

To Convert a number to a byte array , the developers can use the BitConverter.GetBytes method which returns array of bytes. How to Convert a Number to Bytes Array in C# ? Below is a sample code snippet demonstrating how to convert a Number to Byte Array in C# .