TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
600
70.9k
Extension Method
Dec 13 2014 3:43 PM
https://www.youtube.com/watch?v=D3OCSkXLFuk
This program is given in the above website.
Normally caller method and called method should have same number of parameters. But here caller method has one parameter and called method has two parameters. Please explain the reason. Problem is highlighted.
using System;
namespace Extension_Methods___YouTube
{
class Program
{
static void Main(string[] args)
{
var p = new Person { Name = "John", Age = 33 };
var p2 = new Person { Name = "Sally", Age = 35 };
p.SayHello(
p2
);
Console.ReadKey();
}
}
public static class Extensions
{
public static void
SayHello(this Person person, Person person2)
{
Console.WriteLine("{0} says hello to {1}", person.Name, person2.Name);
}
}
}
//John says hello to Sally
Reply
Answers (
2
)
how to put Custom Header value in Http request without a key
Design Your Own Graph