Answer the question
In order to leave comments, you need to log in
What is the best way to retrieve data from a database?
What is more optimal in terms of the complexity of the query to the database, the speed of its execution and the memory occupied after the query is completed?
Such a request:
var itemName = dbcontext.Items.Where(i => i.id == 1).Select(i => i.Name).FirstOrDefault();
var itemName = dbcontext.Items.FirstOrDefault(i => i.id == 1)?.Name;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question