|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using ProjectBusiness;
namespace ConsoleForMultiConnectionTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Operation started.");
try
{
for (int index = 0; index < 100; index++)
{
Thread statusUpdateThread = new Thread(new ThreadStart(RunOnThread));
statusUpdateThread.IsBackground = true;
statusUpdateThread.Start();
}
}
catch (System.InvalidOperationException invalidOperatioExcpetion)
{
throw;
}
catch (System.Data.SqlClient.SqlException sqlException)
{
throw;
}
catch
{
throw;
}
Console.WriteLine("Operation completed... Press <Enter> to exit.");
Console.ReadLine();
}
private static void RunOnThread()
{
Project SomeProject = new Project() { Name = "SomeProject" };
List<Employee> employees = new List<Employee>()
{
new Employee(){Name ="A"},
new Employee(){Name ="B"},
new Employee(){Name ="C"},
new Employee(){Name ="D"},
new Employee(){Name ="E"}
};
employees.ForEach(e => e.AddProject(SomeProject));
SomeProject.UpdateStatus();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.