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

Entity Framework 6 - Knowledge Base (KB)

44 results for: in tag: many-to-many

LINQ to entities - Building where clauses to test collections within a many to many relationship

So, I am using the Linq entity framework. I have 2 entities: ...Content... and ...Tag.... They are in a many-to-many relationship with one another. ...Content... can have many ...Tags... and ...Tag... can have many ...Contents.... So I am trying to write ...
c# entity-framework lambda linq many-to-many
asked by Phobis

Using the entity framework to add existing entities to a collection on a newly created entity

I am using the Entity framework to create a new order. The order contains a collection of contacts, a many to many relationship. I want to add a reference to an existing contact on the order on creation of the order. Both Order and Contact a Entity Obj...
entity-framework many-to-many
asked by kirkmcpherson

Entity framework and many to many queries unusable?

I'm trying EF out and I do a lot of filtering based on many to many relationships. For instance I have persons, locations and a personlocation table to link the two. I also have a role and personrole table. ...EDIT: Tables: Person (personid, name) Perso...
.net entity-framework many-to-many
asked by John Landheer

How to delete many-to-many relationship in Entity Framework without loading all of the data

Does anyone know how to delete many-to-many relationship in ADO.NET Entity Framework without having to load all of the data? In my case I have an entity ...Topic... that has a property ...Subscriptions... and I need to remove a single subscription. The co...
ado.net entity-framework many-to-many
asked by Emil

Entity Framework - Linq To Entities - Many-To-Many Query Problems

I am having problems querying many-to-many relationships in Linq To Entities. I am basically trying to replicate this query using Linq:...Select * FROM Customer LEFT JOIN CustomerInterest ON Customer.CustomerID = CustomerInterest.CustomerID LEFT JOIN In...
entity-framework left-join linq-to-entities many-to-many
asked by JD.

Insert/Update Many to Many Entity Framework . How do I do it?

I'm using EF4 and new to it. I have a many to many in my project and cannot seem to work out how to insert or update. I have build a small project just to see how it should be coded....Suppose I have 3 tables...Class : ClassID-ClassName ...Student : Stude...
c# entity-framework many-to-many
asked by user9969

Self-referencing many-to-many recursive relationship code first Entity Framework

I can't seem to make this work at all...class Member { public virtual IList<Member> Friends { get; set; } [Key] public int MemberId { get; set; } public string Name{ get; set; } } ...I tried adding Mappings but in vain. Is there a way to d...
c# code-first entity-framework many-to-many
asked by Korayem

Entity framework code first many to many

I've searched everyhwere but couldn't find an answer......First, I have created a many to many relationship using code first which worked well. Each person can be in multiple clubs and each club can have multiple members. The ...ClubPersons... table has b...
code-first ef-code-first entity-framework many-to-many
asked by Leon

Create code first, many to many, with additional fields in association table

I have this scenario:...public class Member { public int MemberID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public virtual ICollection<Comment> Comments { get; set; } } public class Comment...
c# ef-code-first entity-framework many-to-many
asked by hgdean

Unable to create a constant value of type (type) Only primitive types ('such as Int32, String, and Guid') are supported in this context

I've read ALL of:...Unable to create a constant value of type 'System.Object' in Entity Framework...Entity Framework - "Unable to create a constant value of type 'Closure type'..." error...Entity Framework - Union causes "Unable to create a constant value...
entity-framework linq linq-to-entities many-to-many
asked by Can PoyrazoÄŸlu

Entity Framework 4.1+ many-to-many relationships change tracking

How can I detect changes of ICollection<> properties (many-to-many relationships)?...public class Company { ... public virtual ICollection<Employee> Employees { get; set; } } using (DataContext context = new DataContext(Properties.Settings.Defau...
change-tracking entity-framework many-to-many
asked by Boris Mitchenko

CRUD Views For Many-Many Relationship, Checkboxes

I am having a hard time trying to figure out what I need to do to get this to work. I'm learning ASP.NET MVC CodeFirst with EF. If I make a model I can simply add a controller for that model and add scaffolding to create views that automatically take care...
asp.net-mvc checkbox code-first entity-framework many-to-many
asked by Shane LeBlanc

Many-to-many mapping table

From examples that I have seen online and in a Programming Entity Framework CodeFirst book, when you have a collection on both classes EF would create a mapping table such as ...MembersRecipes... and the primary key from each class would link to this tabl...
c# ef-code-first entity-framework many-to-many
asked by Pricey

MVC + EF Code First Many to Many relationship: Create view with checkbox

I'm a newbie with MVC + EF Code First and have some doubts about many to many relationship. ...I created 2 tables that has many to many relationship (userprofile and courses). Sounds simple but it got pretty complex for me: ...I want to see the "create" ...
asp.net-mvc asp.net-mvc-3 entity-framework many-to-many razor
asked by PnP

Saving Many to Many relationship data on MVC Create view

I have some issues with a Many-to-many relationship saving the results of a create view....I want to do a create page for a new user profile that has a checklist that lets them choose courses (many to many relationship). My view takes the records from the...
asp.net-mvc asp.net-mvc-3 entity-framework many-to-many razor
asked by PnP

Build a nested lambda Expression Tree for an Entity Framework Many to Many relationship?

I am trying to build an Entity Framework 4 Many to Many relationship filter, this is for a Dynamic Data project. I know that I need to build an Expression Tree at run time, and I am familiar with doing this for something like a simple where expression li...
.net entity-framework expression-trees linq many-to-many
asked by Brian Tax

Many to Many Relationships not saving

I have two entities with a fairly standard Many to Many relationship that I created in EF 5 Code First. These are Service and ServiceItem. The Service entity contains a collection of ServiceItems and the ServiceItem contains a collection of Services. I...
entity-framework many-to-many
asked by drobertson

Entity Framework adding record into many to many mapping table

I have 3 tables, ...1) Customer (Id, Name, bla bla)...2) CustomerGroups (GroupId, GroupName)...3) CustomerInGroups (CustomerId, GroupId)...using (var context = DataObjectFactory.CreateContext()) { context.Customers.Add(entity); con...
.net c# entity-framework many-to-many
asked by Null Reference

Entity Framework Many to Many works but Include does not

I have a typical many-to-many relationship with these 3 tables...[Post] ( [PostId] int, (PK) [Content] nvarchar(max) ... ) [Tag] ( [TagId] int, (PK) [Name] nvarchar ... ) [TagPost] ( [TagId] int, (PK, FK) [PostId] int (PK, FK) ) ...And,...
ef-code-first entity-framework linq many-to-many
asked by Ray

MVC 4 - Many-to-Many relation and checkboxes

I'm working with ASP.NET MVC 4 and Entity Framework. In my database, I have a table ...Subscription... which represents a subscription to public transports. This subscription can provide access to several ...public transport companies... (so a subscriptio...
asp.net-mvc c# checkbox entity-framework many-to-many
asked by Traffy

Page 1 of 3
  • 1
  • 2
  • 3
  • »

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
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now