SHASHANGKA SHEKHAR'S BLOG

Hi, I am Shashangka Shekhar, Working with Microsoft Technologies. This is my personal blog where I share some of my experiences.

Error & Exception

In this article we will focus on Exception Handling, clarify our knowledge on different type of Exceptions, and also identify difference between Exception and Error.

Short Overview:

Error:

  1. Error means system doesn’t handle.
  2. Stop the application being executed with errors.
  3. Cause while syntax error, may occur while writing code.

Exception:

  1. Abnormal things happen cause Exception.
  2. Interrupts the application execution.
  3. Cause while application logic fails, something exceptional.

Read More

IEnumerable Vs IQueryable

Differences between them based on their properties :

IEnumerable

  1. NamespaceSystem.Collections Namespace
  2. Derives from: No base interface
  3. Deferred Execution : Supported
  4. Lazy Loading : Not Supported
  5. How does it work : While querying data from database, IEnumerable execute select query on server side, load data in-memory on client side and then filter data. Hence does more work and becomes slow.
  6. Suitable for : LINQ to Object and LINQ to XML queries.
  7. Custom Query : Doesn’t supports.
  8. Extension method parameter : Extension methods supported in IEnumerable takes functional objects.
  9. When to use : When querying data from in-memory collections like List, Array etc.
  10. Best Uses : In-memory traversal

Read More

Classes in C#.Net

A class is a blueprint, that defines the attributes and behaviors of the objects, that are created as instances of the class.

Classes are declared by using the keyword class followed by the class name and a set of class members surrounded by curly braces. Every class has a constructor, which is called automatically any time an instance of a class is created. The purpose of constructors is to initialize class members when an instance of the class is created. Read More

Casting and Type Conversions

Type conversion is converting one type of data to another type. It is also known as Type Casting. In C#, type casting has two forms:

  • Implicit type conversion – These conversions are performed by C# in a type-safe manner. For example, are conversions from smaller to larger integral types and conversions from derived classes to base classes.(সফটওয়ারের দায়িত্তে)
  • Explicit type conversion – These conversions are done explicitly by users using the pre-defined functions. Explicit conversions require a cast operator.(নিজের দায়িত্তে)

Read More

Boxing and Unboxing

Boxing: Implicit conversion of a value type (int, char etc.) to a reference type (object), is known as Boxing. In boxing process, a value type is being allocated on the heap rather than the stack. Read More

Constructor

Constructor is a special method of a class or struct.

When a class or struct is created, its constructor is called. Constructors have the same name as the class or struct, and they usually initialize the data members of the new object. Read More

Accessor

Dictionary Meaning:

The meaning of “Accessor” is “Someone or something that accesses”.

What is Accessor?

In C# programming, the accessor function is like getter accessor (get) and setter accessor (Set) functions. This is used to change the class member access label by set to public.

In OOP aspects as it provides an abstraction layer that hides the implementation details of functionality sets. Read More