entity-framework

How does Microsoft's Entity Framework inhibit test driven development?

MS's entity framework is considered among developers in the agile community to inhibit test driven development. It was famously attacked by an influential group of .Net developers for not being a true reflection of the principles of the agile movement. What are the main drawbacks that an agile developer faces when using the entity fr...

Adding a Business Layer to ADO .NET Entity Framework

I'm working on my first .NET project (.NET 3.5, ADO.NET and C#). We've built our entity models and are trying to build a clean business objects layer. We've got our basic entity model and we want to add certain business-level semantics to the default data accessors (navigation properties, etc). For example, let's assume that we have a...

how to use asp.net dynamic data with Entity framework in another dll

how can i use asp.net dynamic data using EF in another dll and i dont want to put connection string in web.config or any config file. I have this code in Global.asax model.RegisterContext(() => new MyObjectContext("entityconnectionString"), new ContextConfiguration() { ScaffoldAllTables = true }); the defalut page is ok but when i cli...

Which is the best book out there to learn Linq, including Linq to Entities?

I heard lots of reviews on the book Linq in Action, but it does not cover Linq to Entities. Please provide your feedback on the books you may have read. ...

Exception When Using Entity Framework On GoDaddy

I am trying to use the Entity Framework in an ASP.NET application hosted at GoDaddy. I keep receiving the following error: Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change ...

How can we get DynamicData working with EFPocoAdapter?

My team is hoping to use the EFPocoAdapter, but are also hoping to use the DynamicData tools with it but are having some issues. We basically added a "Dynamic Data Entities Web Application" project to the EFPocoAdapter Northwind sample solution (I am using the latest version, 1.03), referenced the needed assemblies and then uncommented ...

Do I have to make a select query to create a relationship in Entity Framework?

I want to create a Blog object which has a relation between User. To create the relationship do I have to select User entity first, then set it to User property of Blog object? In Entity Framework samples suggest to set the User object to ViewState and retrieve it when you need to create the relationship, like a basic cache. Is this ne...

L2SQL or EF?

Hi guys I am wondering what's your opinion about this. I have used L2SQL in my last project, and its a great OR mapping system. I have never used EF yet, however I have read that the Microsoft team seem to give it more importance than the L2SQL. What's your opinion? (edit: multiple duplicates - see comments, most notably: Entity Fra...

MethodInfo for EntityCollection instead of Queryable

I am manually creating the equivalent lambda: var function = p => p.Child.Any(c => c.Field == "value"); I have a MethodInfo reference to the "Any" method used with Expressions built in code. MethodInfo method = typeof(Queryable).GetMethods() .Where(m => m.Name == "Any" && m.GetParameters().Length == 2) .Single().MakeG...

Can you develop using .NET 3.5 SP1 and run under just .NET 3.5

Can I develop a website which utilizes ADO .NET Entities in the .NET Framework 3.5 SP1 and then deploy it on another machine with just the .NET 3.5 framework? ...

Entity Framework: Creating custom properties

Consider an implementation of the Entity Framework in a DAL assembly. I am needing to add a custom read-only property to an entity. Person Class, as defined in the DB, contains fields like: PersonID FirstName LastName In the above example, I'd like to make a property called FullName. It would be the concatenation of FirstName + " "...

Association end is not mapped in ADO entity framework

I am just starting out with ADO.net Entity Framework I have mapped two tables together and receive the following error: Error 1 Error 11010: Association End 'OperatorAccess' is not mapped. E:\Visual Studio\projects\Brandi II\Brandi II\Hospitals.edmx 390 11 Brandi II Not sure what it is I am doing wrong ...

Error: The object cannot be deleted because it was not found in the ObjectStateManager.

Trying to get a handle on Entity Framework here and I am hitting some speedbumps... I have a Get() method that works fine and has been tested, buut my Delete method is not working: public static void Delete(string name) { J1Entities db = new J1Entities(); db.DeleteObject(Get(name)); db.SaveChanges(); }...

Intercept entity saving with ADO.NET Entities Framework

I want to invoke a validation function inside the entities objects right before they are stored with ObjectContext#SaveChanges(). Now, I can keep track of all changed objects myself and then loop through all of them and invoke their validation methods, but I suppose an easier approach would be implement some callback that ObjectContext ...

Entity Framework: Using transactions and rollbacks... Possible?

Issue: (With Sql 2005) How can I query the database while the transaction is up? (Since it locks the table) How can cause a transaction to rollback and then close itself to allow the table to be queried? So I found this much: [TestMethod] public void CreateUser() { TransactionScope transactionScope = new TransactionScope(); ...

Is there a way to export the .edmx diagram from VS2008 to Visio?

Some people want to see the DB structure and dont have VS, is there a way to do this? Or any other way to export it outside of a screencapture (it is a huge diagram). Thank you. ...

Remove autogenerate GUID column from Add Entry pages in Dynamic Data Web Application

I have a Dynamic Data Entities Web Application that uses a database with GUIDs as primary keys for tables. All of the GUID fields have the default value set to NEWID() so SQL Server will generate a new GUID for any record. However in my dynamic data web site, in the insert new entry pages the GUID field shows up and it is expected for th...

WPF designer won't load with entity framework

I have been having real problems getting the WPF designer to work in VS 2008 when i use the entity framework. I have a user control that gets data from an entity model. The user control designer loads fine but the main window throws the following error "Could not create an instance of type 'CampaignList". When i compile the project there...

Should I share the Entity-Framework context or create a new context for each operation?

I'm not that clear on the best-practice concerning the use and re-use of the entity-framework Context. My question is, should I try to create 1 context and re-use it many times for different queries or should I create a new context for each query? For example if I have a form with 10 charts all with data queried from the same tables, s...

Entity Framework - Working with Detached entities issue

Ok, so in this example I have a parent entity called Template. A Template always has a type. The type is an FK that is very likely to already exist. The problem comes when creating a new Template and adding to it the type. Once the type is added and you go to add the Template you receive an error. Which error you receive depends on the a...