Top "Entity-framework" questions

Entity Framework is a LINQ-based object-database mapper for .NET.

The cast to value type 'Int32' failed because the materialized value is null

I have the following code. I'm getting error: "The cast to value type 'Int32' failed because the materialized value …

c# .net entity-framework linq-to-entities
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 { …

c# entity-framework ef-code-first many-to-many
keyword not supported data source

I have an asp.net-mvc application with the default membership database. I am accessing it by ADO.NET Entity Framework. …

asp.net entity-framework connection-string
Package Manager Console Enable-Migrations CommandNotFoundException only in a specific VS project

I tried to run the command 'Enable-Migrations' in a new project and I got the message: PM> Enable-Migrations The …

entity-framework migration
How do I get the max ID with Linq to Entity?

I have a table User which has an identity column UserID, now what is the correct Linq to Entity line …

c# linq entity-framework linq-to-entities
How to add/update child entities when updating a parent entity in EF

The two entities are one-to-many relationship (built by code first fluent api). public class Parent { public Parent() { this.Children = new …

c# asp.net-mvc entity-framework asp.net-web-api
How can I make my string property nullable?

I want to make the Middle Name of person optional. I have been using C#.net code first approach. For …

c# asp.net-mvc entity-framework entity-framework-migrations
What is POCO in Entity Framework?

I just started learning POCO but cannot understand its use and advantage. Even following link of stackoverflow did not help …

c# .net entity-framework poco
Entity Framework Core add unique constraint code-first

I can't find way to add a unique constraint to my field with using attribute: public class User { [Required] public …

c# entity-framework entity-framework-core
LINQ to Entities does not recognize the method

I'm getting the following error when trying to do a linq query: LINQ to Entities does not recognize the method …

.net linq entity-framework linq-to-entities specification-pattern