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)

10 results in tag: one-to-many

Prevent extra foreign key columns in One to Many relationship

I'm trying to figure out how to configure EF to handle the below situation involving one parent and multiple children:...public class Parent { public int ParentId {get; set;} [ForeignKey("SpecialChildOneId")] public virtual Child SpecialChild...
c# ef-code-first entity-framework entity-framework-6 one-to-many
asked by Brian Vallelunga

One to many relationship with junction table using Entity Framework code first

I'm creating a database using EF6 code first, and am struggling to create a one-to-many relationship using a junction table....Here's an example of what I'm trying to do:...Foo... entities can contain any number (0-n) of ...Bar... entities, however ...Bar...
ef-code-first entity-framework entity-framework-6 one-to-many
asked by Alfie Woodland

Can you save the parent entity in a one-to-many relationship in entity framework?

I have a simple, one-to-many, relationship between two entities....public class Contact { public string Id { get; set; } public string FirstName { get; set; } // the children public List<Message> Messages { get; set; } } public class Mess...
c# entity-framework entity-framework-core one-to-many
asked by Matt

Entity Framework core one to many relationship

I'm trying to build a code first data model with a one to many relationship....There is a UserDTO and a RoleDTO model with the User containing one to many roles....Some simplified code for the RoleDTO is:...internal class RoleDTO { public UserDTO User...
c# entity-framework-core one-to-many
asked by Josh R

EF Core one-to-many without Foreign Key (FK)

Are there ways to make one-to-many (abstract) relation without using SQL foreign keys?...I know it could be made by joining 2 non-related tables. But is it possible to use EF Core default navigation tools?
entity-framework entity-framework-core foreign-keys one-to-many
asked by lagrange-

EF6 OutOfMemoryException Evaluating Entity with varbinary(max) Property

In my WebAPI web app, I've added a varbinary(max) field to a table, and a byte[] field to the POCO (BatchCharge). This entity has a child entity (Charge). ...Visual Studio 2013, Entity Framework 6, SQL Server 2014....The data model is as follows:...public...
entity-framework entity-framework-6 one-to-many varbinarymax
asked by Udi Bar-On

EF Core 2.1: Self-referencing entity with one to many relationship generates additional column

I have the following entity:...public class Level { public int LevelId { get; set; } public int? ParentLevelId { get; set; } public string Name { get; set; } public virtual Level Parent { get; set; } public virtual HashSet<Level> Chil...
c# ef-core-2.1 ef-fluent-api entity-framework-core one-to-many
asked by Davide De Santis

Entity Framework Core. How to update the related data properly?

This question is a common one, but I still can't understand how to update the related entity properly?...I have the following code:... public async Task<bool> UpdateStepAssignedToLevelAsync(Step step, Guid levelId, int priority = -1) { var ...
c# entity-framework-core one-to-many sql-update
asked by Nikita Fedorov

How to Create Drop-Down-List from Database in (Asp.net Core - MVC)?

I have 2 models:...News Model...TypeOfNew Model...with (one to many relationship), every (TypeOfNew) has one or multiple news....News Model:...public class News { [Required(ErrorMessage = "ID إجباري.")] [Key] public int ID { get; set; } ...
asp.net-core-mvc drop-down-menu entity-framework-core one-to-many
asked by askm

How to save/update only parent entities without saving its childs entities in EF6 in asp.net mvc?

I am working on a survey application with Asp.Net MVC....I have a page named Index.cshtml which has a question table and a 'Add New' button.Once button clicked, a popup is opened with jQuery. I am calling a view from controller to fill jQuery dialog named...
asp.net-mvc-4 c# entity-framework entity-framework-6 one-to-many
asked by user6172721

Page 1 of 1
  • 1

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!