Avatar of deanlee17
deanlee17
 asked on

Entity Framework and Linq queries

Hi guys,

Ok this is a bit of a general question. We started using entity framework, dragging the tables across from the data source window (as grids) and letting EF do the binding. But this soon started getting messy with links and removing all auto generated code when removing grids etc. So I started to write Linq queries linking to EF and populating the grid with the Linq results.

Will we run into problems with this if 2 users fire the same query to the database at the same time or will EF manage this? in terms of saving data and returning a unique ID

My boss asked a valid question in that why are we using EF if its not doing the binding for us and why don't we go back to our own method of doing our own database connection, firing SQL queries, getting results and closing database connection?

I know this is an odd question but I was just looking for general advice and possibly your opinions on how you do things.
.NET ProgrammingLINQ Query

Avatar of undefined
Last Comment
Imran Javed Zia

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Imran Javed Zia

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
deanlee17

ASKER
Great info in the links. Ok so if I had a scenario where I have 2 users uploading 10,000 records at once it would complete one users database inserts before moving on to the second user?
Imran Javed Zia

As per my understanding, either you use ado.net or EF, in such scenario, you have to manually implement transactions or semaphore (lock statement) as per requirements.

Like if there is requirement that when 1st batch is in process then the 2nd batch may not execute in such case you may use semaphore, alternatively you may use transaction.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck