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

Entity Framework 6 - Knowledge Base (KB)

6940 results

How do I get rid of Error 3002?

Say I have the following table definitions in SQL Server 2008:...CREATE TABLE Person (PersonId INT IDENTITY NOT NULL PRIMARY KEY, Name VARCHAR(50) NOT NULL, ManyMoreIrrelevantColumns VARCHAR(MAX) NOT NULL) CREATE TABLE Model (ModelId INT IDENTITY NOT N...
.net-3.5 entity-framework linq-to-entities sql-server-2008
asked by Andrew

"The underlying supplier failed on Open," says Entity Framework.

When I try to insert a record, I get this error : The underlying provider failed on Open. This error occurs only with IIS and not with VWD 2008's webserver. In the EventViewer I get this Application Error : ...Failed to generate a user instance of SQL Se...
asp.net entity-framework
asked by pokrate

Entity Framework Template is missing after installing Visual Studio 2010 on Windows 7 64-bit.

I just install Visual Studio 2010 on a 64 bit VM with Windows 7 64 bit. The VM is on an ESXi Hypervisor. When I tried to create my first project I don't see the Entity Framework template (ADO .NET Entity Framework). Am I missing a step here? Any and a...
entity-framework visual-studio-2010 windows-7
asked by Brono The Vibrator

Is database connection pooling used by Entity Framework? Is it the case by default?

I have been searching for a while about how EF utilizes connections to SQL Server DB, and whether it is using Connection pools under the hood, but I couldn't find any details about that.
ado.net entity-framework sql-server
asked by bashmohandes

Why is an ICollection required for lazy loading in the entity framework?

I want to write a rich domain class such as...public class Product { public IEnumerable<Photo> Photos {get; private set;} public void AddPhoto(){...} public void RemovePhoto(){...} } ...But the entity framework (V4 code first app...
domain-driven-design entity-framework lazy-loading
asked by Akk

LINQ to Entities returns the top N records.

I am using Linq to entities and would like to know if I can get a limited number of records when i query. I just need the top N records as the query do the orderby and other clauses. Is this possible or I will have to get the top N using foreach loop?
entity-framework linq
asked by Abdel Raoof

With Object Framework 4, how do I remove a child entity from a parent collection?

I'm using Entity Framework 4 and have a one-to-many relationship between a parent and child entity. I'm trying to delete a child using the parent repository by removing it from the parent's children collection:...public virtual void RemoveChild(Child chil...
cascading-deletes entity-framework
asked by simonjreid

Entity Framework's self-join

I want to have following type of query in entity frame work...SELECT c2.* FROM Category c1 INNER JOIN Category c2 ON c1.CategoryID = c2.ParentCategoryID WHERE c1.ParentCategoryID is NULL ...How to do the above work in Entity framework...
c# entity entity-framework
asked by Waheed

The best SQL Server storage pattern for (product) characteristics

We are starting a new project where we need to store product and many product attributes in a database. The technology stack is MS SQL 2008 and Entity Framework 4.0 / LINQ for data access....The products (and Products Table) are pretty straightforward (a...
database database-design entity-framework sql sql-server
asked by EdH

The Include is gone if I choose from an IQueryable.

The ...include... does not work after I perform a select on the ...IQueryable... query. Is there a way around this? My query is...public IQueryable<Network> GetAllNetworks() { var query = (from n in _db.NetworkSet .Include("NetworkCont...
anonymous-types entity-framework include linq-to-entities
asked by Connor Murphy

LINQ to Entities nested list projection

Assuming these objects......class MyClass { int ID {get;set;} string Name {get;set;} List<MyOtherClass> Things {get;set;} } class MyOtherClass { int ID {get;set;} string Value {get;set;} } ...How do I perform a LINQ to Entities Q...
c# entity entity-framework linq-to-entities
asked by ctorx

When the database changes, how do you update the model in Entity Framework?

If you build the edmx file from the database and then the db changes, how do you get the model to pick up the change?...Do you delete the whole model and regenerate or can you detect changes?...I see a post mentioning a "Update Your Model" rt. mouse comma...
entity-framework
asked by ChadD

In Entity Framework 4.0, how do you implement SQL "in"?

How to implement following query of SQL in entity framework. ...SELECT * FROM Users WHERE UserID in (1,2,3,4).... ...I am trying to do ...var users = from e in context.Users where e.UserId in (list of user ids) ...Thanks Ashwani
c# entity-framework
asked by Ashwani K

Entity Framework selects a single row value.

I am using Entity Framework from .NET 3.5...I have two tables with 0-1 to many relation. Let's say Citizen and City. Each citizen has foreign key column (ID) that connects him to City....When i select single citizen, i also need to select the name of the ...
.net-3.5 c# entity-framework
asked by Alex

Is there a repository for each table or one for each functional section?

I am using ASP.NET MVC 2 and C# with Entity Framework 4.0 to code against a normalised SQL Server database. A part of my database structure contains a table of entries with foreign keys relating to sub-tables containing drivers, cars, engines, chassis etc...
asp.net-mvc c# entity-framework
asked by Ian Roke

Using Entity Framework and DataAnnotations

I have used the Entity Framework with VS2010 to create a simple person class with properties, firstName, lastName, and email. If I want to attach DataAnnotations like as is done in this ...blog post... I have a small problem because my person class is dy...
asp.net-mvc-2 c# entity-framework validation
asked by dcompiled

Entity Framework and Autonumber

I want to loop through a collection of objects and add them all to a table. The destination table has an auto-increment field. If I add a single object there is no problem. If I add two objects both with the primary key of zero, the entity framework fa...
auto-increment c# entity-framework exception
asked by dcompiled

EntityType Exception mapping and metadata information could not be found.

I am trying out ASP.NET MVC Framework 2 with the Microsoft Entity Framework and when I try and save new records I get this error: ...Mapping and metadata information could not be found for EntityType 'WebUI.Controllers.PersonViewModel'...My Entity Framewo...
asp.net-mvc-2 c# entity-framework metadata viewmodel
asked by dcompiled

Nullable Foreign Key Error in Entity Framework

I have a Website table that has a foreign key to a Client table. A Website isn't always going to have an associated Client but when I save a Website without specifying a client then it errors out, as Website.ClientID is an int32 (not nullable) and is set...
entity-framework nullable
asked by Justin

Entity Framework 4 has a problem with complex types, stored procedures, and temp tables.

I am skinning my knees on Entity Framework 4 and running into a slight problem. ...I have some stored procedures that I am pulling into my EDMX. When I create complex types from these procs, EF has no problem getting the column information. Except in o...
complextype entity-framework
asked by Repellr

Page 21 of 347
  • ««
  • «
  • …
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • …
  • »
  • »»

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
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!