entity-framework

Entity Framework with MySQL connector in c#

I have been trying to get the Entity Framework to work in my web application using MySQL. It works fine on my local pc, but doesn't work when I put it on the server. Since the server is a shared server I can install the connector if that is the issue. ...

Are both LINQ and Entity Framework considered ORM?

What is the difference between LINQ and Entity Framework Are both LINQ and Entity Framework both considered ORM? What is the advantages of both. ...

Navigation property name from RelatedEnd in Entity Framework

How do I get both source and target navigation property names for a given RelatedEnd? ...

asp.net mvc many-to-many one-to-many

Hello, I am new in asp.net MVC, and in Entity Framework to. I watch on asp.net mvc tutorials, but they are very easy. I need to write little site, and in my database have one-to-many reletionship. if i want to select data from two tables (classic inner join), what you recommended to use, db views or Linq to Entity queries. If Ling to Ent...

Entity Framework use of indexes and foreign keys

I want to be able to search a table quite quickly using the Entity Framework, say if I have a Contacts table, a JobsToDo table and a matrix table linking the two tables e.g Contacts_JobsToDo_Mtx and I specify two foreign keys in the Contacts_JobsToDo_Mtx table, if I wanted to search this Mtx table, do I need to specify an index on the tw...

Asynchronous data loading in Entity-Framework?

Did anyone hear about asynchronous executing of an EF query? I want my items control to be filled right when the form loads and the user should be able to view the list while the rest of the items are still being loaded. Maybe by auto-splitting the execution in bulks of items (i.e. few queries for each execution) all in same connection...

When querying with 'Include', does the EF checks if objects already exist in object state manager?

Should I avoid using Include in queries, or I can rely on the EDM that when it creates the query it excludes from the query items that already exist in the OSM? ...

Entity framework - exclude list of values

Is there a way to exclude a list of values for an object attribute when querying the database through entity framework? I tried to be slick and pull this number: List<String> StringList = new List<String>(); StringList.Add("ya_mama"); StringList.Add("has"); StringList.Add("fleas"); servicesEntities context = new servicesEntities(); va...

Cannot rollback ransaction with Entity Framework

I have to do queries on uncommitted changes and I tried to use transactions, but I found that it do not work if there are exceptions. I made a simple example to reproduce the problem. I have a database with only one table called "Tabella" and the table has two fields: "ID" is a autogenerated integer, and "Valore" is an integer with a Un...

Best practice approach for automated testing

Hi All, This is a very strange request for advice for which I truly feel there is no real answer. In my project I have archiving routines on various objects that have been consumed for logical calculations, I archive these items for the sake of audit trail and to check up on calculation errors or prove correctiveness at a later stage. I...

How to read Metadata values from Silverlight Client with RIA Services

I have an RIA Services Silverlight 3.0 app using an EF model. In the model metadata I've included several Display Name properties that I'd like to use when referring to the model on the client-side (in TextBoxes, etc.. .) I'm using reflection now to get the properties of the model on the client so that if the model changes over time, I ...

SQL Server 2008: Very slow query performance when dealing with specific date boundary

Right, this is an odd one. We have a web service that returns data to a silverlight client. The queries are generated against a SQL Server 2008 database using the entity framework. Most of these queries are date range based - pull results between this date and that, for example. Also, a view is used to make things a little easier. We h...

Is EntityReference.Load checking for EntityReference.IsLoaded?

Hi I was wondering if EntityReference.Load method includes If Not ref.IsLoaded Then ref.Load() My question is basically: Dim person = Context.Persons.FirstOrDefault person.AddressReference.Load() person.AddressReference.Load() 'Does it do anything? ...

ObjectContext.Refresh() ???

How to update ALL the dirty entities from the data store, and reset their changed values to the original store value? The method ObjectContext.Refresh requires as a parameter the entities to be refreshed. ...

LINQ-to-Entities select clause containing non-EF method calls

I'm having trouble building an Entity Framework LINQ query whose select clause contains method calls to non-EF objects. The code below is part of an app used to transform data from one DBMS into a different schema on another DBMS. In the code below, Role is my custom class unrelated to the DBMS, and the other classes are all generated ...

Adding Entity Framework entities (one-to-many) in JSON via ASP.NET WebMethod

I am currently working on a project utilising both the Entity Framework (the version packaged with the .NET Framework version 3.5 SP1) and lots of AJAX-based functionality, which I am implementing using jQuery on the client-side and ASP.NET WebMethods on the server-side. I typically create new entities using a WebMethod that accepts the...

Dynamic Data without both database and model updates.

I have come to the conclusion that the very nifty ASP.NET Dynamic Data framework would be even more nifty if one only had to implement model changes from one side, model or DB. Right now, if I add a column or table, I must refresh my EF model, and then the scaffolding does the dirty work. I would much prefer a mechanism where I can upd...

MVC 1.0 + EF: Does db.EntitySet.where(something) still return all rows in table?

In a repository, I do this: public AgenciesDonor FindPrimary(Guid donorId) { return db.AgenciesDonorSet.Include("DonorPanels").Include("PriceAdjustments").Include("Donors").First(x => x.Donors.DonorId == donorId && x.IsPrimary); } then down in another method in the same repository, this: AgenciesDonor oldPrimary = this.FindPrimar...

Entity Framework with SQL Server 2000 (APPLY Operator) issue

Hello, I have a simple Linq query below: var seq = (from n in GetObjects() select n.SomeKey) .Distinct() .Count(); This query works find with SQL Server 2005 and above. But, this start to give headache when I hooked the EF to SQL Server 2000. Because EF is using APPLY operator which only SQL Server 200...

Entity Framework: One<->Many<->One Mapping?

I'm trying to get a one to many relationship mapped with the EF and for some reason it's proving more difficult than usual. This is my EDMX and DB Schema. The reason I used an auto-increment key on the middle table is because I was told it's difficult to use composite keys with the EF. What I need is to be able to do (with a Course enti...