User-17257777 posted
Hi rajemessage,
Common query methods are as follows:
1. Find()
When you want to get an item by primary key. This will return null if it can't find an item. It will look in the context before going to the database.
2. First()
When you expect one or more items to be returned by a query but you only want to access the first item in your code (ordering could be important in the query here). This will throw an exception if the query does not return at least one item.
3.Single()
When you expect exactly one item to be returned by a query. This will throw an exception if the query does not return exactly one item.
For more details about LINQ-to-Entities queries, you can refer to
https://www.entityframeworktutorial.net/querying-entity-graph-in-entity-framework.aspx
Best Regards,
Jiadong Meng