Akshay Khot

Akshay Khot

23 Articles Published

Articles by Akshay Khot

23 articles

Explain and contrast value types and reference types in C#

Akshay Khot
Akshay Khot
Updated on 17-Mar-2026 408 Views

In C#, all types can be divided into two main categories − value types and reference types. Understanding the difference between these types is crucial for memory management and avoiding common programming errors. Value Types Variables of value types directly contain their data. Each variable has its own copy of the data, stored on the stack. When you assign one value type variable to another, the entire value is copied. Value types in C# include − All numeric types: int, float, double, decimal, byte, etc. char and bool types struct ...

Read More

Provide a brief overview of the C# and .NET ecosystem

Akshay Khot
Akshay Khot
Updated on 17-Mar-2026 739 Views

C# is an object-oriented, type-safe and general-purpose programming language, which focuses on making the programmers productive. It tries to achieve this productivity through expressiveness, simplicity and a focus on performance. It works on different platforms such as Windows, Mac, and Linux. The .NET ecosystem provides the foundation for C# development, offering a comprehensive runtime environment, extensive libraries, and tools for building various types of applications from desktop to web and mobile solutions. Type-Safety C# is a statically typed language. That means the types are verified when you compile a program. This eliminates a large set of errors ...

Read More

What is the usage of ref, out, and in keywords in C#?

Akshay Khot
Akshay Khot
Updated on 17-Mar-2026 633 Views

In C#, method parameters can be passed using different modifiers that control how arguments are handled. The ref, out, and in keywords allow you to pass parameters by reference rather than by value, each serving different purposes and having specific rules. By default, C# passes arguments by value, meaning a copy of the value is created. Changes made inside the method don't affect the original variable. Default Parameter Passing (By Value) Value Types When passing value types, a copy is made and modifications inside the method don't affect the original variable − using System; ...

Read More

What is the purpose of the StringBuilder class in C#?

Akshay Khot
Akshay Khot
Updated on 17-Mar-2026 564 Views

In C#, strings are immutable, meaning you cannot modify a string once it's created. Any modification returns a new string containing the changes, leaving the original intact. The StringBuilder class provides a mutable alternative for efficient string manipulation when you need to perform multiple modifications. String Immutability Example using System; class Program { static void Main(string[] args) { string word = "aaabbbccc"; string newWord = word.Replace('b', 'd'); Console.WriteLine(word); ...

Read More

System.Reflection namespace in C#

Akshay Khot
Akshay Khot
Updated on 17-Mar-2026 673 Views

The System.Reflection namespace in C# provides classes and interfaces that allow you to examine and interact with assemblies, modules, types, and members at runtime. This powerful feature enables reflection — the ability to inspect and manipulate code dynamically during execution. The Assembly class is central to this namespace, representing a loaded assembly in memory. You can access an assembly through a type's Assembly property or load it dynamically using various methods. Assembly Identity Components An assembly's identity consists of four key components − Simple name − the filename without the extension Version − from the ...

Read More

How does the event pattern work in .NET?

Akshay Khot
Akshay Khot
Updated on 11-Mar-2026 629 Views

Events are a simplified pattern that uses delegates. In C#, all delegates have the multicast capability, i.e., an instance of a delegate can represent not just a single method but a list of methods. For example −Exampledelegate int Transformer(int x); static void Main(){    Transformer perform = x =>{       int result = x * x;       Console.WriteLine(result);       return result;    };    perform += x =>{       int result = x * x * x;       Console.WriteLine(result);       return result;    };    perform(2); // prints ...

Read More

Explain the stream architecture in .NET

Akshay Khot
Akshay Khot
Updated on 11-Mar-2026 652 Views

The .NET streams architecture provides a consistent programming interface for reading and writing across different I/O types. It includes classes for manipulating files and directories on disk, as well as specialized streams for compression, named pipes, and memory-mapped files.The streaming architecture in .NET relies on a backing store and adapters.Backing StoreIt represents a store of data, such as a file or a network connection. It can act as either a source from which bytes can be read sequentially or a destination to which bytes can be written sequentially.The Stream class in .NET exposes the backing store to programmers. It exposes ...

Read More

Explain how Razor Pages work in ASP.NET Core

Akshay Khot
Akshay Khot
Updated on 11-Mar-2026 2K+ Views

Razor Pages simplify the traditional MVC-based programming model by adopting a file-based routing. Razor Pages focus on page-based scenarios for building web applications rather than using controllers and views like a traditional ASP.NET MVC application.Once the application receives an HTTP request, it moves through the middleware pipeline until it reaches a middleware component that can handle and process it. Typically, it's a routing middleware that matches a URL path to a configured route. This route defines which Razor page to invoke for this particular request.Once the router has selected the Razor Page, the framework executes that Razor Page to generate ...

Read More

Explain the ASP.NET Core support for multiple environments for development and production

Akshay Khot
Akshay Khot
Updated on 22-Jun-2021 1K+ Views

Running an application in production for live customers is very different from running it when you are developing it on your local machine. In production, your application is hosted on a server which has very different configurations and specifications than your computer. Various services that your application talks to, such as databases or external APIs change for production.By letting the application know which environment it’s running, you can vary the application’s behavior. ASP.NET Core makes it easy to manage various environments effortlessly. You can configure different configuration settings for different environments, and tweak them without having to recompile the application. ...

Read More

How to schedule background tasks (jobs) in ASP.NET Core?

Akshay Khot
Akshay Khot
Updated on 22-Jun-2021 2K+ Views

Background tasks, also called as jobs, are essentially services that aren’t meant to execute during a normal flow of the application, such as sending email confirmations or periodically cleaning up the database to purge the inactive accounts. These jobs are not meant to interact with the customers or process user input. Rather, they run in the background, handling items from a queue or executing a long-running process.A primary advantage of performing these tasks in a background job or service, you can keep the application responsive. For example, when a user signs up, instead of sending them an email in the ...

Read More
Showing 1–10 of 23 articles
« Prev 1 2 3 Next »
Advertisements