Does EF linq query suggestion order operate?

Do I have to worry about how the Entity Framework linq query class suggestions are made in terms of performance?

In the example below, the order of two conditions can change in which sentences affect the database search result?

        using (var context = new ModelContext())
        {
            var fetchedImages = (from images in context.Images.Include("ImageSource")
                                 where images.Type.Equals("jpg")
                                 where images.ImageSource.Id == 5
                                 select images).ToArray();
        }
+5
source share
2 answers

No, changing these two sentences wherewill not affect performance. The generated SQL will look like this:

WHERE [condition1] AND [condition2]

In addition, you can record conditions in combination with logical operators:

where images.Type.Equals("jpg") && images.ImageSource.Id == 5
+4
source

, where " ", , , , , , .

, .

- .

-1

All Articles