• In this guide, we will discuss what is the difference between String and StringBuilder in C#.  String and StringBuilder in C# dotnet both are nothing more than a class.  String is immutable which means it is not liable to change whereas StringBuilder is mutable which means it is liable to […]

    Difference Between String & StringBuilder Class

    In this guide, we will discuss what is the difference between String and StringBuilder in C#.  String and StringBuilder in C# dotnet both are nothing more than a class.  String is immutable which means it is not liable to change whereas StringBuilder is mutable which means it is liable to […]

    Continue Reading...

  • In the previous tutorial, we have seen how ToString() method works and how to override it.  For built-in types, it works fine but for complex types it will return their type.  There is another method which is pretty much similar to ToString() method and that is Convert.ToString().  But there is […]

    Difference Between ToString() Method and Convert.ToString() Method

    In the previous tutorial, we have seen how ToString() method works and how to override it.  For built-in types, it works fine but for complex types it will return their type.  There is another method which is pretty much similar to ToString() method and that is Convert.ToString().  But there is […]

    Continue Reading...

  • In dotnet, every type directly or directly inherit from Object class.  Object class contains some methods like ToString(), GetHashCode(), Equals(), etc and all of these methods are available to all the derived classes.  As the name suggests, ToString() works fine with the built in types but in case of complex […]

    ToString() Method Overriding in C# with Example

    In dotnet, every type directly or directly inherit from Object class.  Object class contains some methods like ToString(), GetHashCode(), Equals(), etc and all of these methods are available to all the derived classes.  As the name suggests, ToString() works fine with the built in types but in case of complex […]

    Continue Reading...

  • In general, when we want to create a collection of items, we make use of arrays due to their strongly typed nature.  The only drawback which we experience is that they cannot grow in size.  Their size depend upon their initialization. Due to this reason, in dotnet v1.0, collections were […]

    What are Generics in C# with Example

    In general, when we want to create a collection of items, we make use of arrays due to their strongly typed nature.  The only drawback which we experience is that they cannot grow in size.  Their size depend upon their initialization. Due to this reason, in dotnet v1.0, collections were […]

    Continue Reading...

  • In this C# reflection tutorial, you will learn what is reflection in C# and how to use it.  In dotnet, whenever you compile an application, an assembly is generated.  That assembly could be an executable file or a dll file.  As we know, all dotnet applications contains MSIL or CIL […]

    Reflection in C# with Example

    In this C# reflection tutorial, you will learn what is reflection in C# and how to use it.  In dotnet, whenever you compile an application, an assembly is generated.  That assembly could be an executable file or a dll file.  As we know, all dotnet applications contains MSIL or CIL […]

    Continue Reading...

  • LINQ Aggregate methods help in various common calculations like getting average, count, sum etc of values in a collection.  In C#, we have 6 LINQ Aggregate methods. Min():  LINQ Aggregate Min method will give us lowest value in a collection. Max():  LINQ Aggregate Max method will give us highest value […]

    LINQ Aggregate Methods in C#

    LINQ Aggregate methods help in various common calculations like getting average, count, sum etc of values in a collection.  In C#, we have 6 LINQ Aggregate methods. Min():  LINQ Aggregate Min method will give us lowest value in a collection. Max():  LINQ Aggregate Max method will give us highest value […]

    Continue Reading...

  • LINQ stands for Language Integrated Query.  LINQ enables us to query various type of data sources such as SQL server, XML documents,  in memory objects like arrays and generics.  In general, if you want to fetch a data from a data source, then you must need to have some technical […]

    What is LINQ in C#

    LINQ stands for Language Integrated Query.  LINQ enables us to query various type of data sources such as SQL server, XML documents,  in memory objects like arrays and generics.  In general, if you want to fetch a data from a data source, then you must need to have some technical […]

    Continue Reading...

  • Extension methods were introduced in dotnet framework 3.5.  Extension methods are basically an instance methods which are added to an existing type without creating a new derived type, recompiling, or originally modifying the code.  C# dotnet framework has provided us a lot of extension methods like where, aggregate, average etc. […]

    Extension Methods in C#

    Extension methods were introduced in dotnet framework 3.5.  Extension methods are basically an instance methods which are added to an existing type without creating a new derived type, recompiling, or originally modifying the code.  C# dotnet framework has provided us a lot of extension methods like where, aggregate, average etc. […]

    Continue Reading...

  • This time, we are going to create a custom attribute class.  We have seen in previous tutorial how Obsolete attribute works.  We are going to replicate a bit of similar functionality in our custom attribute class. First of all, we will create a class called MyName which will inherit from […]

    Creating Custom Attribute in C# with Example

    This time, we are going to create a custom attribute class.  We have seen in previous tutorial how Obsolete attribute works.  We are going to replicate a bit of similar functionality in our custom attribute class. First of all, we will create a class called MyName which will inherit from […]

    Continue Reading...

  • Attributes in DotNet are basically used to add declarative information to classes, properties, methods etc.  This declarative information can be retrieved using reflection at runtime.  An attribute is nothing more than a class which directly or indirectly inherits from Attribute class.  There are a lot of predefined attributes in DotNet […]

    Attribute in C# with Example

    Attributes in DotNet are basically used to add declarative information to classes, properties, methods etc.  This declarative information can be retrieved using reflection at runtime.  An attribute is nothing more than a class which directly or indirectly inherits from Attribute class.  There are a lot of predefined attributes in DotNet […]

    Continue Reading...

Page 1 of 812345...Last »