Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is extended method in c#

Answer Posted / ashish agrawal

Extension methods enable you to "add" methods to existing
types without creating a new derived type, recompiling, or
otherwise modifying the original type. Extension methods are
a special kind of static method, but they are called as if
they were instance methods on the extended type. For client
code written in C# and Visual Basic, there is no apparent
difference between calling an extension method and the
methods that are actually defined in a type.

class ExtensionMethods2
{

static void Main()
{
int[] ints = { 10, 45, 15, 39, 21, 26 };
var result = ints.OrderBy(g => g);
foreach (var i in result)
{
System.Console.Write(i + " ");
}
}
}
//Output: 10 15 21 26 39 45

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we set image Source dynamically using C# in WPF application?

1126


What is a .aspx file?

915


Is it possible to have different access modifiers on the get/set methods of a property?

1107


If c# destructors are so different to c++ destructors, why did ms use the same syntax?

973


What are the advantages of using c#?

979


Is c# the same as d flat?

958


Please write a program to display “welcome to bestinterviewquestion.com” in c#?

962


What is disco?

980


Explain how to add controls dynamically to the form using c#.net.

1008


Explain About .Net remoting

1046


What is unrecognized escape sequence in c#?

980


Can abstract class have parameterized constructor?

969


Which compiler switch creates an xml file from xml comments in the files in an assembly?

1051


What is reference c#?

1014


Define a manifest in .net?

1059