Top "Dbcontext" questions

The DbContext API first shipped with Entity Framework version 4.1 and provides a more productive surface for working with the Entity Framework and can be used with the Code First, Database First, and Model First approaches.

DbContext discard changes without disposing

I have a desktop client application that uses modal windows to set properties for hierarchical objects. Since this is a …

c# .net entity-framework dbcontext undo
EF6 DBContext Dynamic Connection String

public partial class ProcessContext : DbContext { static ProcessContext() { Database.SetInitializer<ProcessContext>(null); } public ProcessContext() : base("Name=ProcessCS") //Comes from …

entity-framework asp.net-mvc-4 .net-4.5 dbcontext
Entity Framework 5 deep copy/clone of an entity

I am using Entity Framework 5 (DBContext) and I am trying to find the best way to deep copy an entity (…

entity-framework-5 dbcontext
Using TransactionScope with Entity Framework 6

What I can't understand is if its possible to make changes to the context and get the changes in the …

c# entity-framework-6 dbcontext transactionscope savechanges
Using DbContext Set<T>() instead of exposing on the context

Are there any differences when doing the following: public class UsersContext : DbContext { public DbSet<User> Users { get; set; } } …

c# .net entity-framework ef-code-first dbcontext
The operation cannot be completed because the DbContext has been disposed using MVC 4

I know that this Question is asked so many times. I have read and implemented all solution but didn't get …

c# asp.net-mvc linq entity-framework dbcontext
EntitySet System.InvalidOperationException - "the entity type is not part of the model for the current context"

Similar Questions The entity type <classname> is not part of the model for the current context -and- EF 4.1 …

c# entity-framework dbcontext ef-model-first csdl
LINQ to Entities only supports casting EDM primitive or enumeration types with IEntity interface

I have the following generic extension method: public static T GetById<T>(this IQueryable<T> collection, …

c# .net entity-framework expression-trees dbcontext
Migration: No DbContext was found in assembly

Using VS Community 2017. I have tried to create initial migration with error message saying: Both Entity Framework Core and Entity …

c# entity-framework model-view-controller dbcontext entity-framework-migrations
How can I log all entities change, during .SaveChanges() using EF code first?

I'm using EF code first. I'm using a base Repository for all my repositories and an IUnitofWork that inject to …

c# logging ef-code-first repository dbcontext