entity-framework

Entity Framework: Load all references?

I have lots of other referenced entities in one of my entity objects. Is there a quick way just to say "if there's something not loaded in here, go ahead and load it" without doing them each individually? ...

Entity Framework - Update Model From Database... - no update happens!

I have a table in my DB called CompanyDetails. It has a column called CharacterID varchar(255). I just changed it from a NOT NULL column to a NULL column. I ran the 'Update Model From Database...' command in the model browser as well as in the EDMX file viewer. This is what it created in the designer: /// <summary> /// There are no ...

How to eager load in WCF Ria Services/Linq2SQLDomainModel

I have a databound grid at my view (XAML) and the Itemsource points to a ReportsCollection. The Reports entity has three primitives and some complex types. These three are shown as expected at datagrid. Additionally the Reports entity has a property of type Store. When loading Reports via GetReports domain method, I quickly figure out th...

How to save manual change after a update using Entity framework designer?

Hi all, I'm using entity framework designer to build entities. I found the designer really hard to use because it overwrite all your manually change after each model update using the designer. How did you round off this problem? Thanks! ...

How to delete slave entity in entity framework poco in one line

The following code: order.Orderlines.Remove(orderline) means not only to remove relationship between Order and Orderline but also to remove orderline from persistence permanently. Many slave entities have this situation. As I know, in entity framework have to write extra code: context.DeleteObject(orderline); or context.Orderline...

Plinqo 4 vs EF 4

Does anyone has experience with plinqo 4? what are the benefits vs EF 4? ...

Entity Framework 4.0 Best Practise for Creating Object Context

Hi, I would like to know what is the best practice for creating object context instance. Prior to Entity Framework, we are advised to delay the creation of connection object until the point when we need it to execute query and dispose it as soon as we are done with it in order to conserve resources. Will this practice applicable to the...

ORM to abstract a traditional database plus a WCF service.

Suppose one is using Microsoft's Entity Framework as an ORM to abstract/work with a database. Next comes a requirement which causes the application to have the need to work with a WCF service and a traditional database, simultaneously. To my knowledge no ORM tool exists that can abstract a WCF service in the same manner as Entity Frame...

Entity Framework - Is there a best practice way to accomplish this?

I have 2 databases and need to transfer data from the 1st database (Read Only) into the 2nd database (Read Write) and am wondering if there is a better way than what I am doing. Still new to EF so don't know all the tricks and would like to learn how to keep my round trips to the databases to a minimum. The code basically responds to...

deferred execution

Hi, I would like to know whether lazy loading == deferred execution ? Thanks Regards Yong ...

Can I map incomplete sproc columns to an entity?

I am using the latest beta of Visual Studio 2010 and the Entity Framework. It's mostly really neat, but here's my situation: I have a table T with columns Id and Name. I have an auto-generated entity with Id and Name properties. Finally, I have a stored procedure that selects only Id from T. Trying to map my entity to the stored p...

Updating an MVC application Model along with data-source

Firstly, new to Asp.Net MVC and ADO.NET entity data model. While practicing an example, I created a table but forgot to set "Identity specification" to true for PK. Created a model for MVC Application using entity data Model and worked fine. Later on I've have set that "Identity specification" to true for that table in the DB. When I...

Database migrations for Entity Framework 4

I've been playing with Entity Framework 4, using the model driven approach to generate the database script from my entities. This is great but I'm not sure how this works when it comes to versioning the database. I'm guessing if I wanted to use an active record type migration framework I'd have to work the other way around and generate m...

Entity framework supported databases

I'm going to make a end-user desktop application, so I need a relative small database, such as Firebird or SqlLite. Does the Entity Framework 4 support other databases than SQL Server? ...

How to persist an object graph in non-silverlight clients with WCF Ria Services?

I have just created my domain service from my windows mobile application project via the add reference menu. I construct my objects (Report -> ReportEntries, one-to-many) but I find it very hard to persist them. I understand that I will make use of the SubmitChanges(ChangeSetEntry[]) method but my difficulty lies in the construction of t...

WCF to Entity Framework converts my datetime into local time - how to stop?

Hi there, I've got a WCF service which receives records with datetime values, and saves them to an Azure SQL db, using Entity Framework 3.5, SP1. Running it locally, the records get saved to the database, all is well However, my IIS hosting is in a different timezone. When I upload the site to there and call the same service (with the ...

Entity Framework - Scoping context in a web app

Hi I have implemented a simple repository pattern for the Entity Framework in a web app. I have several repositories which all subclass a base which has some common methods in The base looked like this public class BaseRepository<TEntity> : IRepository<TEntity> { protected readonly RedirectsEntities Context; public BaseRepos...

Error when creating a new entity foo, editing a previously existing foo, then saving. Generic 4004 error

The steps are as simple as that so I imagine there's something else going on here, the problem is I just get back 4004, no exception anywhere etc, making it annoying to debug, I get this from the ie error window Microsoft JScript runtime error: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: ...

MS Entity Framework VS NHibernate and its derived contribs (FluentNHibernate, Linq for NHibernate)

I just read this article about the Entity Framework 4 (actually version 2). Entity Framework seems to offer a huge improvement over its first release. Thus, I have never ever used EF in any project, since I think EF is not mature enough in comparison to NHibernate. NHibernate and its current contributions of FluentNHibernate and Linq f...

Entity Framework: ObjectContext.ExecuteStoreQuery produces detached objects

I need to run some custom SQL to return a list of objects from a table. I'm using ExecuteStoreQuery for that. var q = context.ExecuteStoreQuery<ProductionUnit>(MySelectString, new SqlParameter("@ProductionUnitId", value)); This does result in q containing an ObjectResult collection, but the actual ProductionUnit elements are Detached ...