Error & Exception

C# Basic

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.

Continue reading “Error & Exception”

IEnumerable Vs IQueryable

C# Basic, MVC

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

Continue reading “IEnumerable Vs IQueryable”

Classes in C#.Net

C# Basic

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. Continue reading “Classes in C#.Net”

Casting and Type Conversions

C# Basic

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.(নিজের দায়িত্তে)

Continue reading “Casting and Type Conversions”

Accessor

C# Basic

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. Continue reading “Accessor”