.

Parallel code execution

Example of executing code in parallel:

public void FetchEXAMPLE()
{
    var service = new service();
    Task.WaitAll(
        new[]
            {
                Task.Factory.StartNew(
                    () => { AdUsers = service.GetADUsers(); }),
                Task.Factory.StartNew(
                    () =>
                        {
                            Staffs = service.GetUnlinkedStaff();
                            StaffTypes = service.GetAllStaffTypes();
                        })
            });
}

What's your thoughts on this?

*

Protected by WP Anti Spam