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)

6642 results

Joining multiple tables from different databases

I am working on ASP.NET core application where I am using Entity Framework to interact with SQL server database. so far, I was using ...Scaffold-DbContext... command to create new model from SQL server database. Even if , we wanted to create ...DbContext....
entity-framework entity-framework-core
asked by Sanket

EF Eager fetching derived class

I´m using EF6 and trying to eager fetch the whole structure of an object. The problem is that i´m using inheritance....Let´s say that i have this classes....DbContext...DbSet<A> A { get; set; } ...Example classes...public class A { public string Id...
c# entity-framework entity-framework-6
asked by Henrik

There is already an object named AspNetRoles in the database. (entity-framework-core)

I have an asp.net core mvc website using entity framework core....I don't know how it initially happened, but I can't get past the error: "There is already an object named AspNetRoles in the database"...I ended up deleted the database, deleting all my mig...
asp.net-core asp.net-core-mvc asp.net-identity entity-framework-core
asked by mejobloggs

EntityFramework Core: Eager loading navigation properties of derived types

I'm using EntityFramework Core, and am trying to eager-load navigation properties that only exist on some derived type (all within a single query). Probably best to demonstrate with a simple example....Assume you have some data structure like...class Tran...
c# entity-framework entity-framework-core linq-to-sql
asked by Bogey

Creating new table with foreign key with Entity Framework Core

I have a ...DbContext... which I via the developer command prompt and creating a migrations schema turn in to my database. But if you look at the product object I have a dictionary object named ...Parts.... That property does not get added to the ...Produ...
.net-core asp.net-core asp.net-core-mvc c# entity-framework-core
asked by Robel Haile

Concurrent threads in DB transaction cause major delay in .NET Core EF Core

Background...I am trying to write an ...async... server that works with SQLite DB. I am using .NET Core with ...Entity Framework Core.......I am using UnitOfWork with GenericRepository patterns, but as my sample code below shows, this is not really relate...
.net-core c# database entity-framework-core multithreading
asked by Wapac

Linq to entities extension method inner query (EF6)

Can someone explain to me why the EF Engine is failing in the following scenario?...It works fine with the following expression:...var data = context.Programs .Select(d => new MyDataDto { ProgramId = d.ProgramId, ProgramName = d.Pr...
c# entity-framework entity-framework-6 extension-methods linq
asked by MihaiP.

How do I change the name of the ASPNETUsers table to User?

I am using the default authentication system created by ASP.NET Core, and I'd like to know ?...how to change the name of the ...ASPNETUsers... table to ...User... ?...How to add the following property to the table: ...public string DisplayName {get; set;}...
asp.net-core entity-framework entity-framework-core
asked by enet

How to filter "Include" entities in entity framework?

Entities:... public class Room { public Room() { this.Reservations = new HashSet<Reservation>(); } public int Id { get; set; } public decimal Rate { get; set; } public int HotelId { get...
c# entity-framework entity-framework-6
asked by Randel Ramirez

Create relationships with Entity Framework Core

I want to build a database with Entity Framework Core. I use the command prompt and migrations to create the database. But as you can see on my diagram, I have a many-to-many relationship. How do I create this relationship with my classes below?...Code:..
asp.net-core-mvc c# database entity-framework entity-framework-core
asked by Robel Haile

Can I generate script of a migration with EF code first and .net core

I'm building a MVC application with .Net Core and I need to generate the script of a migration....With EF6 I did run the command ...update-database -script ...but when I try to do the same with .net Core is throwing the next exception:...Update-Database :...
.net asp.net-core asp.net-core-mvc entity-framework entity-framework-core
asked by Gabriel Castillo Prada

Migration to/from not found while creating migration script with ASP.NET Core tools

I am trying to use the command ...dotnet ef migrations script... in order to create an SQL script for between the last applied migration and the last not applied migration. Applied migration is one for which is called ...dotnet ef database update...I try ...
asp.net-core ef-migrations entity-framework-core
asked by feradz

Why is it a bad idea to have a table without a primary key?

I am very new to data modeling, and according to Microsoft's Entity Framework, tables without primary keys are not allowed and apparently a bad idea. I am trying to figure out why this is a bad idea, and how to fix my model so that I do not have this hol...
entity-framework entity-framework-6 sql sql-server
asked by KateMak

The underlying provider failed on Open / The operation is not valid for the state of the transaction

Here is my code...public static string UpdateEmptyCaseRevierSet() { string response = string.Empty; using (System.Transactions.TransactionScope tran = new System.Transactions.TransactionScope()) { using (var db = new Entities.WaveEntities(...
c# entity-framework entity-framework-6 transactionscope
asked by user1831795

Entity Framework 6 Disable Interception temporarily

I am using an ...IDbCommandTreeInterceptor... to enable soft deletes on my model....System.Data.Entity.Infrastructure.Interception.DbInterception.Add( new SoftDeleteInterception()); ...I want to be able to disable the interceptor temporarily so that ...
database entity-framework entity-framework-6 soft-delete
asked by MrZander

Id's jumping up 1000 every time I build my app and insert a new record

I'm building a basic CRUD page following beginner asp.net-core-mvc/ef-core tutorials...I've been noticing every time I rebuild and create a new record through my mvc site my Id's jump up 1000...Example, currently the id's for my first few rows are:...1, 2...
asp.net-core entity-framework entity-framework-core
asked by mejobloggs

Entity Framework Core: Include many-to-many related objects in WebAPI

I'm not too familiar with the .NET framework but decided to try out ASP.NET Core and EF Core. I want to make a pretty simple Web API backend but I'm having trouble working with many-to-many relationships....I understand that I need to make a relationship ...
asp.net-core asp.net-core-webapi entity-framework entity-framework-core linq
asked by yalibaba

Dependency-injection Exception when configuring EntityFramework Core

//the Startup.cs file configuration settings. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddEntityFramework().AddSqlServer().AddDbContext<PortContext>(); } ...project.json... { "dependencies": { "M...
.net-core asp.net-core asp.net-core-mvc c# entity-framework-core
asked by thilanka1989

Many to Many relationship in Asp.Net MVC 5 with Identity table and Custom table

I'm trying to make a relationship between the Users from the table generated by Asp.Net Identity with my own table. The relationship must be many to many, since many Users can work on the same Task (which is my table), and same time an User can work on mu...
asp.net-mvc-5 ef-code-first entity-framework entity-framework-6 foreign-keys
asked by Arianit

Get Id of Generic Entity of EF 6

I write a generic repository to CRUD in EF.In add method is written like this...public class GenericRepo<T> where T : class { //Create public static void Add(CellPhoneProjectEntities dbContext, T entity) { dbContext.Set...
c# entity-framework entity-framework-6 generics
asked by syed mhamudul hasan akash

Page 80 of 333
  • ««
  • «
  • …
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • …
  • »
  • »»

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!