Advantages of using Angular 2 over Angular 1

Angular 2 has lots of advantages over AngularJS or Angular 1 but we have mentioned some of them as below: Angular 2 is a platform not only a language. Better Speed and Performance. Simpler Dependency Injection. Benefits of ES6 and Typescript. Flexible Routing with Lazy Loading Features. Angular 2 implements web standards like everything will […]

Read More

Interview questions and answers for 3-8 year experience

What is the difference between an abstract class and interface? When would you want to use them? OOP Concepts practical questions example in C# Static Class in C# What are Anonymous methods? What is the difference between Finalize()and Dispose()? What is the difference between ref and out parameters? What is the difference between Var, object […]

Read More

Where is View State data stored in asp net?

View State data is stored in a hidden field called “__VIEWSTATE” on a Web page. It stored data in Base64 String encoded format which can be further decoded. Sample hidden field looks like below: <input type=”hidden” name=”__VIEWSTATE” id=”__VIEWSTATE” value=”/wEPDwUKMTM1ODM3Nj…….” /> This single hidden field contains all the viewstate values for all the page controls. You […]

Read More

Event vs Delegate

Event and Delegate are interrelated. In this post, we will learn how they are different each other. An Event declaration adds a layer of abstraction and protection on the delegate instance. This protection prevents clients of the delegate from resetting the delegate and its invocation list and only allows adding or removing targets from the […]

Read More

Difference between Singleton and Static class

A singleton classes allowed to create a only single instance or particular class. That instance can be treated as normal object. You can pass that object to a method as parameter or you can call the class method with that Singleton object. While static class can have only static methods and you can not pass […]

Read More

LINQ Single vs SingleOrDefault vs First vs FirstOrDefault

Single(), SingleOrDefault(), First() and FirstOrDefault() are extension methods of the Enumerable class. Many people get confused about the difference between Single, SingleOrDefault, First, and FirstOrDefault methods in Linq. Let’s understand the difference between all these methods as below: Single() SingleOrDefault() First() FirstOrDefault() Description Returns a single, specific element of a sequence Returns a single, specific […]

Read More

Constructor Chaining in C#

Constructor chaining is an approach where a constructor calls another constructor in the same class or base class. It is very useful when we have a class that defines multiple constructors. Before knowing how to use constructor chaining in C#. Let’s first see why we need constructor chaining. Example: We have a class called “Employee” and […]

Read More

Nullable type or double question mark in C#

The ?? operator is called the null-coalescing operator. It returns the left-hand operand if the operand is not null; otherwise it returns the right hand operand. Example:- int? x = null; // Set y to the value of x if x is NOT null; otherwise, set y to -1. int y = x ?? -1;

Read More

ROW NUMBER, RANK and DENSE RANK in SQL

In this post, We will learn the difference between Row_Number, Rank, Dense_Rank and how to use with example. ROW_NUMBER, RANK and DENSE_RANK functions are used to calculate RowID for the result set which is returned from a query but in a slightly different way. Firstly, We will create a table and insert some record for […]

Read More

Difference between throw and throw ex

We can say “throw” maintains the full hierarchy in the stack trace and gives complete information about the exception occurred in the code. Whereas “throw ex” pretends that exceptions occurred on the line where “throw ex” was written and removes all the hierarchy above the method containing the “throw ex” expression.

Read More

Difference between IEnumerator and IEnumerable

IEnumerable An enumerable class implements the IEnumerable interface. The IEnumerable interface has only one method GetEnumerator, which returns an IEnumerator interface. public IEnumerator GetEnumerator(); Example:- class Program { static void Main() { List<int> list = new List<int>(); list.Add(1); list.Add(2); list.Add(3); list.Add(4); list.Add(5); List<int>.Enumerator e = list.GetEnumerator(); Write(e); } static void Write(IEnumerator<int> e) { while (e.MoveNext()) […]

Read More

How to start a Thread in C#

We have to use the Thread class provided by System.Threading namespace. In the constructor of the class, we have to pass the method name which we want to run in separate thread. After than we have to call the start method of Thread class. Example:- using System; using System.Threading; namespace ConsoleApplication1 { class Program { […]

Read More

Difference between Lazy Loading and Eager Loading

Lazy/Deferred Loading In lazy loading, related objects (child objects) are not loaded automatically with its parent object until they are requested. By default LINQ supports lazy loading. With Lazy Loading, we only retrieve just the amount of data, which we need in a single query. When we need more data related to the initial data, […]

Read More

Why we need Multi-threading in our project

Multi-threading is running the multiple threads simultaneously. We can do multiple tasks simultaneously with the help of Multi-threading. For e.g. saving the details of user to a file while at the same time retrieving something from a web service. Threads are much lightweight than process. They don’t get their own resources. They used the resources […]

Read More

Static Class in C#

Static Class:- We can create static class or member by using static keyword. Static class or member can be used when object of class or member not change every time. Static class or member are loaded at time of namespace are loaded by CLR. We cannot create instance of static class because static class member […]

Read More