UrbanPro

Learn .Net Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What are extension methods in C#?

Asked by Last Modified  

1 Answer

Learn .Net

Follow 1
Answer

Please enter your answer

Trainer

Extension methods are methods added to an existing type without modifying it or deriving from it. These methods enable to extend the functionalty of existing types. They are implemented as static methods but are invoked as if they were instance methods on the extended type. For client code there is no...
read more

Extension methods are methods added to an existing type without modifying it or deriving from it. These methods enable to extend the functionalty of existing types. They are implemented as static methods but are invoked as if they were instance methods on the extended type. For client code there is no difference between calling an extension method and the methods defined within the type.
To define and call the extension method
1. Define a static class to contain the extension method.
2. The class must be visible to client code (most probably a public class).
3. Include a static method in this class to implement the extension method.
4. The first parameter of this method specifies the type that the method is about to extend; it must be preceded with the "this" modifier.
5. In the calling code, add a using directive to specify the namespace that contains the extension method class.
6. Call the extension methods in the client code as if they were instance methods on the type.

read less
Comments

Related Questions

I want to expertise in dot net. But I don't have any programming knowledge.
Hi Banhi, It is a journey and not a one shot thing. First Step is Learning, Second is Training/Working on Demo or a LIVE Project. Like in any other journey you will feel that it is a very long thing but...
Banhi
How to create different types of cells references in Excel
A cell reference refers to a cell or a range of cells on a worksheet and can be used in a formula so that Microsoft Office Excel can find the values or data that you want that formula to calculate. In...
Vijayalakshmi G M
What is the difference between asp.net and vb.net?
asp.net is web technology that is used in building web applications and websites. Vb.net is language that is used in writing programs that are utilizing the asp.net framework Asp.net contains...
Aadarsh
How to learn asp.net
asp.net is a web technology, pre requirements for jump start asp.net. you need markup knowledge with styles and dom scripting. then choose your good command on scripting language like c# scripting or vb...
Rahul
What is the difference between asp.net and vb.net?
ASP.Net is known as a development platform for the web, which in turn is known to help create robust web applications. It is known to contain innumerous libraries which have a wide range of functionality....
Manshi

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Recommended Articles

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for .Net Training ?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for .Net Training Classes?

The best tutors for .Net Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn .Net Training with the Best Tutors

The best Tutors for .Net Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more