Single, SingleOrDefault, First, FirstOrDefault in Entity Framework
In this article let us look at the Single, SingleOrDefault, First, FirstOrDefault methods in Entity Framework. These methods return a single record from the database based on a Where condition. We use these methods when the Where condition is not part of the Primary Key, But we want only one record in the query result. If the Where condition is part of the primary key then use the find method.
Single, SingleOrDefault, First, FirstOrDefault in Entity Framework Read More »