zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

93 results in tag: dbcontext

Configure multiple database Entity Framework 6

In my solution I have 2 projects that use Entity Framework 6. Each points to a different database, both using the same data provide - SQL Server. A third project in my solution needs to use both databases. My problem is how to configure those context. I t...
c# dbcontext entity-framework entity-framework-6
asked by Motty

Two (almost) concurrent DbContexts causing problems: How to share between Controller and AuthorizeAttribute

Every once in a while, I'm encountering the following exception in my ASP.NET/MVC5/WebAPI2/EF6/MSSQL application:...System.InvalidOperationException: The context cannot be used while the model is being created. This exception may be thrown if the context ...
asp.net-mvc-5 concurrency dbcontext entity-framework entity-framework-6
asked by Alex

What happens to my DbContext after I run a stored procedure that modifies my entities?

Scenario...: I have a custom ...DbContext.... I am using the ...StoreConnection... property of the underlying ...ObjectContext... to run a stored procedure that modifies several entities (which have a ...DbSet... in my custom ...DbContext...). My DbConte...
c# dbcontext entity-framework entity-framework-6 stored-procedures
asked by Adam Modlin

Creating a database with EF6 SQL Server CE Code First crashing

I am seeing this error when I run my app...[MissingMethodException: Method not found: 'System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher System.Data.Entity.Infrastructure.Interception.DbDispatchers.get_Connection()'.] System.Data.En...
code-first dbcontext entity-framework entity-framework-6 sql-server-ce
asked by Sonic Soul

Memory leak in Entity Framework database context

I am trying to figure out this problem for 3 days i have done lots of googling on the internet and use profile analyzer (...dotmemory 4.0...)....I use Castle Windsor as dependency injection library and entity framework 6 code first model. Most of the mode...
c# dbcontext entity-framework entity-framework-6 memory-leaks
asked by Can Günaydın

Entity Framework : The model backing the 'EFDbContext' context has changed since the database was created

I'm working on a project with EntityFramework and MVC, and I keep getting this error :...The model backing the 'EFDbContext' context has changed since the database was created....The problem is that there are no migration pending (I've tried to delete/rec...
asp.net-mvc c# dbcontext entity-framework entity-framework-6
asked by Romain André-Lovichi

EF7: DBContext configuration on ASP.NET 5 Web-API

I'm currently developing an ASP.NET 5 Web-API application with VS2015 Ultimate Preview. Some things have changed about configuring EF7 on this new platform....I've already checked the help in this page: ...https://github.com/aspnet/EntityFramework/wiki...
asp.net-core asp.net-web-api dbcontext entity-framework-core
asked by NetCito

Dependancy Injected DbContext is empty after populating DbContext created with new (EF7, ASP.NET 5, vnext)

I am relatively new to EF7 and have heard that Dependency Injection of DbContexts into the Controller constructor is a good way to go about getting the DbContext for use within given Action methods. However, there are many situations where Dependency Inje...
asp.net asp.net-core dbcontext entity-framework entity-framework-core
asked by Ryan

How do you configure the DbContext when creating Migrations in Entity Framework Core?

Is there way that dependency injection can be configured/bootstrapped when using Entity Framework's migration commands?...Entity Framework Core supports dependency injection for ...DbContext... subclasses. This mechanism includes allowing for configurati...
.net-core c# dbcontext dependency-injection entity-framework-core
asked by vossad01

Best place to enable lazy loading in entity framework 6

What is the best place to keep lazyloading enable condition in my web application. Because when I am using database first approach of EF and when try to update the context then my all setting got wiped out. Below are my settings.... public DBEntities(): ...
dbcontext entity-framework entity-framework-6
asked by Rajaram Shelar

Add child object to tables When parent object saved into context

I have upgraded the EntityFramework objectContext to DBContext latest version v6.1.3 for my MVC Webapplication. Here used DataBase First approach...Have scenario to add order process in to Database using EDMX. The below code behavior will added the object...
asp.net-mvc dbcontext entity-framework entity-framework-6
asked by Anandh_Techie

ASP.NET 5, Entity Framework 7 & SQL Server 2014 - multiple dbContexts, SQL views

I have created a solution in Visual Studio 2015 consisting of a Web project (using the ASP.NET 5 Beta 6 Web Application Preview Template), and a Model project (using Entity Framework 7 Beta 6)....I got to the point where I could get data from a SQL Server...
asp.net-core dbcontext entity-framework-core sql-server-2014 visual-studio-2015
asked by Jerms

Invalid ObjectName xxx.dbo.xxx, but it is there

I do not understand, why the following Code does not work:... //Database connection using (var db = new KassenautomatEntities()) { //Create Model var quittung = new WAWI_Quittungen { ...
c# dbcontext entity-framework entity-framework-6 savechanges
asked by Christian Gollhardt

Get List of Modified Objects within Entity Framework 7

I am stumped - upgrading to Entity Framework 7 and I typically override the SaveChanges inside the ...DbContext... to be able to get a list of all the Modified Objects before it changes. Ultimately I have a script that fires that tracks the previous versi...
.net c# dbcontext entity-framework entity-framework-core
asked by kevin c

EF 6 Code First, changing a Foreign Key Id with an Include on navigation property causes "A referential integrity constraint violation occurred" error

I'm using Entity Framework 6.1.3 and have the scenario where I retrieve an entity with its navigation property (using Include()) and disconnect it from the context, change the foreign key Id then re-attach it to a new DbContext:...// Init the Db using (va...
c# dbcontext ef-code-first entity-framework entity-framework-6
asked by mips

Execute complex raw SQL query in EF6

I am developing a web api using Entity Framework 6. I have to execute a complex SQL query which is getting data from multiple tables as shown in the code. I have tried but get the following error: ...The data reader has more than one field. Multiple field...
dbcontext entity-framework entity-framework-6 sql-server
asked by Awais Mahmood

Entity Framework Core 1.0 DbContext not scoped to http request

I understood by watching this video with Rowan Miller ...https://channel9.msdn.com/Series/Whats-New-with-ASPNET-5/06...(at minute 22)... that the way of configuring Entity Framework Core (previously known as EF7) into an ASP.NET Core 1.0 app (previously k...
asp.net-core-1.0 asp.net-core-mvc dbcontext entity-framework-core middleware
asked by diegosasw

'Microsoft.EntityFrameworkCore.Infrastructure.IDbContextFactory`1[TContext]' violates the constraint of type parameter 'TContext'

It's my first time using asp 5\core1 and i'm having problem setting a entity framework dbcontext...I have one class library with my object...public class Utilizador { public Utilizador() { } public int id { get; set; ...
asp.net-core-1.0 c# dbcontext entity-framework entity-framework-core
asked by Shakawkaw

Entity Framework Core DbContext and Dependency Injection

I'm building a service application using Web API, .Net Core and EntityFramework Core....For configuring options in my DbContext I'm using these lines in "ConfigureServices" method in Startup.cs... var connection = @"Server=ISSQLDEV;Database=EventManagemen...
asp.net-web-api2 dbcontext dependency-injection entity-framework entity-framework-core
asked by Pouyan

How to trigger Update-Database on a DbContext in a referenced assembly (NuGet package)

Using the Package Manager Console I can run a command similar to the following one...Update-Database -ProjectName: My.Project.Data ...The command triggers migrations on ...MyDbContext... defined within the project ...My.Project.Data... located in the curr...
c# dbcontext entity-framework entity-framework-6
asked by Anton

Page 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5
  • ยป

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!