Top "Entity-framework" questions

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

Pass connection string to code-first DbContext

How do I pass a connection string to entity framework's code-first DbContext? My database generation works correctly when both DbContext …

c# entity-framework database-connection
EF LINQ include multiple and nested entities

Ok, I have tri-leveled entities with the following hierarchy: Course -> Module -> Chapter Here was the original …

.net asp.net-mvc-3 linq entity-framework entity-framework-5
How to pass parameters to the DbContext.Database.ExecuteSqlCommand method?

Let's just suppose I have a valid need for directly executing a sql command in Entity Framework. I am having …

entity-framework entity-framework-4.1
There is already an object named in the database

Update-Database failed from Package Manager Console. I've used Entity Framework 6.x and code-first approach. Error is "There is already an …

database entity-framework ef-code-first entity-framework-6 entity-framework-migrations
How to COUNT rows within EntityFramework without loading contents?

I'm trying to determine how to count the matching rows on a table using the EntityFramework. The problem is that …

c# database entity-framework
DbEntityValidationException - How can I easily tell what caused the error?

I have a project that uses Entity Framework. While calling SaveChanges on my DbContext, I get the following exception: System.…

c# entity-framework
Why use ICollection and not IEnumerable or List<T> on many-many/one-many relationships?

I see this a lot in tutorials, with navigation properties as ICollection<T>. Is this a mandatory requirement …

c# entity-framework code-first icollection
Unique Key constraints for multiple columns in Entity Framework

I'm using Entity Framework 5.0 Code First; public class Entity { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public string EntityId { get; set;} public int …

entity-framework ef-code-first constraints multiple-columns unique-key
Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures?

How would you rate each of them in terms of: Performance Speed of development Neat, intuitive, maintainable code Flexibility Overall …

sql linq-to-sql entity-framework ado.net linq-to-entities