Category: C#

How to Throw an Exception in C# ?

To indicate and error which can be handled by the caller function , you can use the throw keyword to throw an exception . For example , below is a sample code snippet demonstrating how to throw an exception in C#. How to Throw an Exception in C# ?

C# Compiler Error – CS8410 ‘{0}’: type used in an asynchronous usin

In this blog post, you’ll learn more about the C# Compiler Error – CS8410 and the related message description C# Compiler Error Code CS8410 C# Compiler Description for the Code :CS8410 ‘{0}’: type used in an asynchronous using statement must be implicitly convertible to ‘System.IAsyncDisposable’ or implement a suitable ‘DisposeAsync’ method.

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

One of the ways to Deserialize an object to JSON string in C# in the Json.NET is using the DeSerializeObject method defined in the JsonConvert method. How to Deserialize an Object in C# using Json.NET ? Below is a sample code snippet demonstrating how you can deserialize an object from Json string to C# object using Json.NET. It takes the json string that contains the…