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

What is icomparer in c#?

887


What is executenonquery c#?

827


How does the lifecycle of Windows services differ from Standard EXE?

961


What is difference between gridview and form view?

959


What is gridview c#?

865


Explain the difference between Metadata and Manifest

891


What is entity framework in c#?

873


Explain the functionalities of satellite assembly?

904


What are the return types in c#?

913


Is stringbuilder better than string?

863


State the top.NET class that everything is derived from?

886


Explain the use of Mutex in C#?

967


User's session is explicitly killed by which method ?

897


What is the difference between final finally and finalize in c#?

879


Explain the role of Garbage collector and its generations?

879