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
nagendra mn
NA
1
0
Multiple Asynchronous request in c#
Oct 22 2008 9:57 AM
I have a situation in which i need to give multiple calls to delegates asynchronously and get the responses. In this code Employee is a class.
I need a callback function which actually gets me both the employees names together.
Ex: class Program
{
public delegate string EmployeeCallback(Employee emp);
private static string UpdateName(Employee emp)
{ return emp.FirstName; }
public static void Main()
{
string appstr = string.Empty;
Employee emp1 = new Employee("Marina", "jimnez", 7000m);
Employee emp2 = new Employee("wilson", "joe", 7000m);
Employee[] emps = new Employee[3];
emps[0] = emp1;
emps[1] = emp2;
Department dep = new Department(emps, "IT");
EmployeeCallback updateCallback = new EmployeeCallback(UpdateName);
foreach (Employee emp in emps)
{ result = updateCallback.BeginInvoke(emp, callbackfunction,null); }
string finalstring = updateCallback.EndInvoke(result);
Console.ReadLine();
}
}
Regards,
Nagu
Reply
Answers (
0
)
richtext box style
string problem