Hi Team,
How to use Thread in Entity Framework?
Here is an example:
I am inserting 10,000 Records into Table
tblProduct objProduct=new tblProduct();
for(int i =0; i<10000; i++)
{
objProduct=new tblProduct();
objProduct.Name="Product Name Here"+i;
objDataContaxt.tblProduct.InsertOnSubmit(objProduct);
objDataContaxt.SubmitChanges();
}
Here Now i want run 5 Process for these 10,000 Records.
ie. I need to insert 5 Records at the same time.
1st process will insert 1 to 200 Records
2nd process will insert 201 to 400 Records
3rd process will insert 301 to 600 Records. etc.
I need to run all the process's at the same time.
Can anybody tell me how is it possible (if thread is the solution then how thread is compatible with my code which is mentioned above.)
Thanks