entity-framework

Method syntax join onto ObjectQuery in LINQ to Entities

For my client's sake, I have forgone pride and dignity and opted for the exampled means of choosing an entityset to select from, but I need to join this to another, fixed, entityset, and this challenge is beyond me today. I need to project a set of attributes from both Department*n,* and another entity set called Sites. I can join Depar...

Is my ASP.NET MVC application structured properly?

I've been going through the tutorials (specifically ones using Linq-To-Entities) and I understand the basic concepts, however some things are giving me issues. The tutorials usually involve only simple models and forms that only utilize basic create, update and delete statements. Mine are a little more complicated, and I'm not sure I'm ...

Make ADO.NET (and EntityFramework) release a database

I'm creating and dropping databases on the fly for some integration tests. I'm doing all the database management at the ADO.NET level. For the tests I'm using Entity Framework because the entities is one part of what I am testing. The problem is that after I do this: using (ProjectEntities db = new ProjectEntities(cs)) { } I cannot dr...

entity-framework, how to project into a list

I've been using linq2sql on a few projects, but i decided it was time to try out EF as its supposed to be more powerful and better. There are a few things that is really annoying tho. One of them is projecting a result into a list, this works well in l2sql but not in EF. public class bo.Transaction { public long Id { get; set; } pub...

Different Connection Strings with Entity Framework based on Context

I have a web forms application that uses entity framework, the application is deployed on a development box, my local machine and a production box. Each of these have different connection strings. What is the best way of handling this. I use TFS Build Server to deploy to development and take the result of that build zip it and copy it t...

Entity Framework Help with LoaderExceptions error

Hi All, I have a Web Service that uses the entity framework. When releasing to a test environment, I recieve the following error: "Unable to load one or more of the requested types." - Stack trace below... The test box has .NET 3.5 SP 1 installed, and I have read a previous post here: http://stackoverflow.com/questions/1091853/unabl...

Snapshot History With Entity Framework

I've been looking at some auditing hooks with Entity Framework. Many of them show old/new value comparisons. This does great for an audit trail but I'm looking to snapshot objects. For example... Let's say I have an application that manages products. A product has multiple attributes and associated other objects. Let's say I chan...

Entity Framework 4.0 Dependencies

From what limited info we have about EF 4.0, does anyone know if we would be able to use EF 4.0 in our IIS 6.0 (Windows Server 2003) using .NET 3.5? I imagine EF 4.0 to siginify .NET 4.0 framework. It'll probably take a year for us to upgrade our production servers to .NET 4.0 some I'm wondering is if we play the waiting game or not f...

Entity Framework 18 seconds on first call to SaveChanges()

I have a very large Entity Framework implementation (100+ tables/entities). The first time SaveChanges is called when doing an update I am experiencing an 18 second wait time. Is this common for large entity framework models? I heard that partitioning the EF model into smaller chunks is a way to improve performance. I am wondering if thi...

Strange LINQ behavior - ToList returning empty set

I cant understand why resultSet2 is empty! Only the first assert passes! List<Tree> resultSet1 = this.datacontext.Trees.Where(t=>t.RiskRating.Contains("bad")).ToList(); Assert.IsTrue(resultSet1.count() == 3); List<Tree> resultSet2 = this.datacontext.Trees.ToList().Where(t=>t.RiskRating.Contains("bad")).ToList(); Assert.IsTrue(resul...

Entity Framework - Inheritance with .Include ?

I think that there's a similar post on here about this but not exactly the same... I have two entities in my EF model - let's call them Person and Developer, with the latter inheriting from the former. I also have an association on Developer called Qualifications. This is not visible on the Person entity. If I'm writing a query agains...

Entity Framework Error on creation

I get the following error: "ERROR: Unable to update Web.Config because of the following exception: 'The value contains embedded nulls (\u0000). Parameter name: provider connection string'." All I'm doing is adding a new model to my ASP.Net MVC app..... Just to be clear, this is when the wizard creates the model from the DB... ...

What is the difference between LINQ to Entities and the Entity Framework?

Simple question: What is the difference between LINQ to Entities and the Entity Framework? Up till now I thought that both were different names to describe the same thing, but I'm starting to get the feeling that it's not ...

.NET RIA Services and Inheritance in EF

How i can use Inheritance in Entity Framework with .NET RIA Services? Problem: if there is inheritance in EF, silverlight application don't compiled. Can you help me? ...

Using Stored Procedure to populate dropdown box using Entity Framework

Hi I am using MS Entity Model to attach to my db, and everything has worked fine. But I have a stored proc that returns a list that has two columns (one int and one text column) and I am trying to bind to a dropdownbox. The examples seem to show returning a single column or returning a data type of one of the tables. But my stored proc...

Is it possible combine transaction scope with committing a transaction inside a stored procedure?

We have a test that runs within a transaction scope. We dispose of the transaction scope at the end to avoid changing the database. This works fine in most cases. However, when we use Entity Framework to execute a stored procedure which contains a transaction, which is committed inside the stored procedure. We get the following error: ...

Assign value to column with reference, using entity framework

Hello I have a problem assigning a value to an entity that has a reference. I get the intellisense and all but I get a null-reference exception when I try to assign it to the object passed into the function that saves to database. public ActionResult BookingViewEdit([Bind(Include = "BookingViewID,Enabled,ObjectLimit,RSSenabled"...

LINQ and EF with string.StartWith(char c)

Hi there, I've got a problem with a search mechanic like as we sometime see on site. I've a big list of says, person. The way to filter a a list of : "#, A, B, C, D, E, [...]". The problèm I have its when i execute de query with EF, an error pop out. Here's is my code. Code : var query = from p in m_context.Persons where ...

ado.net entity framework massive confusion

Hi All, I really hope you can help me as I am about to just throw my MVC/Entity Framework project in the bin and start a MVC/Linq project. I am building a forum as a project just to get to know MVC/Entity, and I have 4 tables which are all related. Forum_Category, Forum, Topic, Reply so there is a 1 to many on Category_ID between F...

Missing many-to-many associations after recompile in ADO.NET Entity Framework

Hello all, I have a simple application using ADO.NET EntityFramework using a many-to-many relationship between two tables (with the use of a mapping table), let's say Books and Authors. I do have the foreign keys correctly associated between the three tables, I can add two Authors for the same Book and the data is written correctly in t...