Nizamuddin Siddiqui has Published 1958 Articles

How to subscribe to an Event in C# and can we have multiple subscribers to one Event in a C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 05-Aug-2020 08:54:19

3K+ Views

Events enable a class or object to notify other classes or objects when something of interest occurs.The class that raises the event is called the publisher and the classes that handle the event are called subscribers.In the EventAn event can have multiple subscribers. A subscriber can handle multiple events from ... Read More

What is #if DEBUG and How to use it in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 05-Aug-2020 08:49:08

11K+ Views

In Visual Studio Debug mode and Release mode are different configurations for building your .Net project.Select the Debug mode for debugging step by step their .Net project and select the Release mode for the final build of Assembly file (.dll or .exe).The Debug mode does not optimize the binary it ... Read More

What is bin and obj folder in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 05-Aug-2020 08:46:35

1K+ Views

Whenever we write a C# code and build or run the solution it generates 2 folders −binobjThese bins and obj has the compiled codeWhy do we have 2 folders?The reason is the compilation process goes through 2 stepscompilinglinkingIn the compiling every individual file is compiled into individual unitsThese compiled files ... Read More

What is the difference between IEnumerable and IQueryable in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 05-Aug-2020 08:43:49

10K+ Views

IEnumerable exists in System.Collections Namespace.IQueryable exists in System. Linq Namespace.Both IEnumerable and IQueryable are forward collection.IEnumerable doesn’t support lazy loadingIQueryable support lazy loadingQuerying data from a database, IEnumerable execute a select query on the server side, load data in-memory on a client-side and then filter data.Querying data from a database, ... Read More

How to create Guid value in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:31:57

2K+ Views

A Globally Unique Identifier or GUID represents a gigantic identification number — a number so large that it is mathematically guaranteed to be unique not only in a single system like a database, but across multiple systems or distributed applications.The total number of unique keys (3.40282366×1038) is so large that ... Read More

How to update the value stored in a Dictionary in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:29:38

7K+ Views

In C#, Dictionary is a generic collection which is generally used to store key/value pairs. In Dictionary, the key cannot be null, but value can be. A key must be unique. Duplicate keys are not allowed if we try to use duplicate key then compiler will throw an exception.As mentioned ... Read More

What is the difference between Foreach and Parallel.Foreach in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:26:05

2K+ Views

Foreach loop in C# runs upon a single thread and processing takes place sequentially one by one. Whereas Parallel.Foreach loop in C# runs upon multiple threads and processing takes place in a parallel way. Which means it is looping through all items at once without waiting for the previous item ... Read More

How to make a method deprecated in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:23:31

4K+ Views

The Obsolete Attribute marks elements like classes, methods, properties, fields, delegates, and many others within our code as deprecated or obsolete. The attribute is read at compile time and it is used to generate a warning or an error to the developer.This attribute can help if we have ever wanted ... Read More

What is an Optional parameter in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:20:32

5K+ Views

By default, all parameters of a method are required. A method that contains optional parameters does not force to pass arguments at calling time. It means we call method without passing the arguments.The optional parameter contains a default value in function definition. If we do not pass optional argument value ... Read More

What is the difference between List and IList in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:17:15

19K+ Views

The main difference between List and IList in C# is that List is a class that represents a list of objects which can be accessed by index while IList is an interface that represents a collection of objects which can be accessed by index. The IList interface implemented from two ... Read More

Advertisements