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

List of foreign keys in Entity Framework Core using SQLite

I want to implement Related Pages structure that one page have a list of other pages related to it. But I could't figure out if it is possible. Now I have the structure like this: ...public class Page { public int ID { get; set; } public string Ur...
c# entity-framework entity-framework-core sqlite
asked by Oleksii Kryzh

Foreign key "The property X on entity type Y could not be found" Entity Framework Core

I've just started working with EF. I have simple models ...Page... and ...Related Pages.......public class Page { public int ID { get; set; } [Required] public string UrlName { get; set; } [Required] public string Title { get; set; } ...
c# entity-framework entity-framework-core foreign-keys
asked by Oleksii Kryzh

Query does not return child collections

I still struggle with this, why each of 'Category' items returns null 'Task' collections. I do have data in the database, what am I missing?...public class ApplicationUser : IdentityUser { public ICollection<Category> Categories { get; set; } } publi...
entity-framework entity-framework-core linq
asked by lucas

Run custom SQL script on app start

I'm using ASP.NET Core and Entity Framework Core. I need to create some views and functions programmatically on the app first start. Is there a way to run some custom SQL code while EF is being configurated?
asp.net-core c# entity-framework-core
asked by Slip

How can I create a database and tables at runtime using Entity Framework 6?

I have an application that is using Entity Framework 6 (database-first). My database already exists, but I would like to be able to run my application in a new environment and have the code create the database and tables if they do not already exist. ...
asp.net-web-api2 c# entity-framework entity-framework-6 sql-server
asked by cortez

Dynamically loading DbSet to DbContext

How do I dynamically load into an EF7 ...DbContext... a X number of classes without explicitly writing them in a ...DbContext... class ?...For example, I tried to avoid it like this:...public class MyDbContextClass : DbContext { public DbSet<Category>...
c# entity-framework entity-framework-core
asked by user3742379

entity framework core maximum classes by model

I know that until EF6 is recommended that break project in small models/contexts, I remember that I saw something around 10 classes per context. Well, this still applicable for EF7 / Entity Framework Core ?
entity-framework entity-framework-core performance
asked by Fernando Magno

Database First Error Entity Framework .NET Core

I am converting an old Class Library to a Class Library Package. This Class Library is the DAL Layer of an old project - which we will be upgrading to latest .NET....In the old Class Library we are using ...edmx... files for Database first. In the new .NE...
asp.net-core c# entity-framework-core
asked by Dawood Awan

WebJob Using Entity Framework Core: Accessing Site Configuration Information

I'm building an ASP.NET Core MVC site which uses an EF Core Sql Server database. ...In part of the site I need to add the ability to upload files, which then get processed and applied to the database. I thought I would use WebJobs for this....What I'm not...
asp.net-core azure-webjobs c# entity-framework entity-framework-core
asked by Mark Olbert

How to isolate EF InMemory database per XUnit test

I am trying use InMemory EF7 database for my xunit repository test. ...But my problem is that when i try to Dispose the created context the in memory db persist. It means that one test involve other. ...I have read this article ...Unit Testing Entity Fram...
.net .net-core c# entity-framework-core in-memory-database
asked by Ivan Mjartan

Saving many-to-many relationship in Entity Framework Core

For example, I have 3 classes, which I'm using for many-to-many relationship:...public class Library { [Key] public string LibraryId { get; set; } public List<Library2Book> Library2Books { get; set; } } public class Book { [Key] public ...
c# entity-framework-core many-to-many
asked by Yurii N.

EF Core relationships query

I'm fairly new to Entity Framework, my tables relationship looks a bit like this...public class Customer { public int Id { get; set; } public string Name { get; set; } public List<Product> Products { get; set; } } public class Product { ...
asp.net-core c# entity-framework-core
asked by Marc

How to call stored procedure from EntityFramework 6 with 'hierarchyid' parameter

I am developing a service using WebApi2 and EntityFramework6. I have a legacy SQLServer DB that my service must work with....That DB is using heavily the 'hierarchyid' data type and this type is used internally in DB's stored procedures....Seems like EF6...
entity-framework entity-framework-6 hierarchyid sql-server stored-procedures
asked by Shonn Lyga

How to perform SUM operation in Entity Framework

I have a table....create table tblCartItem( pkCartItemId int primary key identity, CartId int not null, ProductId int not null, Quantity int not null, Price nvarchar(15) ) ...and I want to perform sum opeartion on that like as ...Select SUM(Price) from tb...
asp.net-mvc asp.net-mvc-4 entity-framework entity-framework-6
asked by Durgesh Pandey

DbContext global scope vs method level scope

If there is a class which works as a data access layer, and provides the functionality of CRUD operations for entities, Which version is the best practice when considering performance & Multi threaded environment (i.e methods of this class are called by m...
c# entity-framework entity-framework-6
asked by Sanjeev

Entity Framework Core error on updating an existing record

In my ...ASP.NET-Core Code First project..., I'm getting the following error on ...SaveChangesAsync()... in the following ...Action Method...:...Error...DbUpdateConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 r...
asp.net-core asp.net-mvc-scaffolding entity-framework-core visual-studio-2015
asked by nam

Many-to-Many EF core with ApplicationUser

I am trying to create a many-to-many relationship between ApplicationUser and Reserve....public class ApplicationUser : IdentityUser { public ApplicationUser() { this.Reserves = new HashSet<Reserve>(); } public bool IsProfessional ...
entity-framework entity-framework-core
asked by Ugo Guazelli

How to create a Clustered Index with Entity Framework Core

From EF6.1, we have a way of specifying a clustered index on a property...public class Person { [Index(IsClustered = true, IsUnique = true)] public long UserName { get; set; } } ...But this Index attribute does not seem to be in EF Core right now? In...
clustered-index entity-framework entity-framework-core
asked by Ray

EF Core Composite Key, one foreign, one auto incrementing

I have this entity:...public class PlayerScoreHistory { public int Id { get; set; } public int PlayerScoreId { get; set; } public DateTime ScoreWhen { get; set; } } ...I need to make a composite key out of both of those ...Id... fields. ...P...
c# entity-framework entity-framework-core sql-server
asked by Callum Linington

What is a proper way of writing entity POCO classes in Entity Framework Core?

EF Core has a "code first mentality" by default, i.e. it is supposed to be used in a code-first manner, and even though database-first approach is supported, it is described as nothing more than reverse-engineering the existing database and creating code-...
.net asp.net-core c# entity-framework entity-framework-core
asked by Titan

Page 74 of 333
  • ««
  • «
  • …
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • …
  • »
  • »»

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!