Introduction To Extension Method In C#

Introduction To Extension Method In C#

The extension method concept allows you to extend/add new methods in the existing class from outside class without modifying the source code.

The extension method concept allows you to extend/add new methods in the existing class from outside class without modifying the source code.

Extension methods are a special kind of static method but they are called as if they were instance methods on the instance type. There is no difference between calling an extension method and the method they are actually defined. It is introduced in C## 3.0.

So let's look at an example of implementing extension methods

First we create a Class named Program, then we create a string and add this code to Program class. Here we want to change the first letter of the string to upper case.

c# introduction extension method

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Extension method in C# | C# static extension method | C# Bangla Tutorial | Advanced C#

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about Extension method in C#. Extension methods, as the name suggests, are additional m...

Extension method example in C# | C# static extension method|C# Bangla Tutorial|Advanced C#

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about Extension method in C#. Extension methods, as the name suggests, are additional m...

Pass method as parameter using C# | Delegates in C# | C# Bangla Tutorial | Advanced C#

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about Pass method as parameter using C#. Blog : http://aspdotnetexplorer.blogspot.com L...

Extensible dynamic type in C# | Expand Object In C# | C# Bangla Tutorial | Advanced C#

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about Extensible dynamic type in C#. Blog : http://aspdotnetexplorer.blogspot.com Like ...

Introduction to C++ Programming Language | C++ Tutorial for Beginners - Part 1

This Edureka video on Introduction to C++ Programming will help you to get started with C++.