Entity Framework

SelectMany in Entity Framework

SelectMany in Entity Framework is an operator which flattens out the collection of collections into one single collection of objects. It is a very useful operator with many use cases.

Entity Framework Include method

Include method in Entity Framework has two overloads. One of which takes navigation property as a string. The other one is Include lambda method. The Include Lambda method is an extension method from the namespace System.Data.Entity. In this tutorial, we look at include method, and learn how to load entities from multiple levels and multiple tables.

Update Record in Entity Framework

Learn how an entity framework update records to the database. We can update records either in connected or disconnected scenarios. In the connected Scenario, we open the context, query for the entity, edit it, and call the SaveChanges method. In the Disconnected scenario, we already have the entity with use. Hence all we need to is to attach/add it to the context. Set its State as Modified and then call the SaveChanges But we need to be careful in a disconnected scenario as the update will update all the fields, Hence a chance of accidentally overwriting a field. We also show you how to update multiple records & Related Data etc.

Scroll to Top