entity-framework

LINQ to entities - Building where clauses to test collections within a many to many relationship.

So, I am using the Linq entity framework. I have to entities "Content" and "Tag" They are in a many-to-many relationship with one another. Content can have many tags and Tags can have many Contents. So I am trying to write a query to select all contents where any tags names are equal to "blah." The entities both have a collection of the...

Is anyone using Entity Framework with an Oracle database?

I am wondering if anyone is already using Entity Framework with an Oracle database in a production environment? There seems to be no support for EF in ODP.Net and only 3rd party data providers (OraDirect) seem to be available to connect with Oracle. Someone mentioned asample data provider available on Codeplex but it is presented with th...

ADO.NET Entity Framework and identity columns

Is the Entity Framework aware of identity columns ? I am using sql server 2005 express edition and have several tables where the primary key is an identity column, when I use these tables to create an entity model and use the model in conjunction with an entity datasource bound to a formview in order to create a new entity I am asked to ...

SQL Anywhere 11 (Sybase) with Entity Framework in Visual Studio SP1?

Well, the question is pretty much in the title. I've just installed Visual Studio SP1, and now when I want to import a Entity Model from a database, it doesn't display the SQL Anywhere provider anymore. Does anyone know if there is a patch or some way to make it work with SP1? Thanks. ...

SQL tracing LINQ to Entities

So, I would like to know oh to do a "full" tracing of Linq to Entities? In other words: I already know about the ToTraceString() method, but this only works on an ObjectQuery. I need it to work on on the entire Linq layer... so when I am doing IQueryable "Where" expressions and additional filtering that I can see the entire query, not ...

Nullable entity projection in Entity Framework

I have a following SQL Server 2005 database schema: CREATE TABLE Messages ( MessageID int, Subject varchar(500), Text varchar(max) NULL, UserID NULL ) The column "UserID" - which can be null - is a foreign key and links to the table CREATE TABLE Users ( UserID int, ... ) Now I have several POCO classes with names ...

How to relate objects from multiple contexts using the Entity Framework

I am very new to the entity framework, so please bear with me... How can I relate two objects from different contexts together? The example below throws the following exception: System.InvalidOperationException: The relationship between the two objects cannot be defined because they are attached to different ObjectContext o...

How to update object with no data contexts

Entity framework provides great flexibility to update data in the same datacontext Dim personA = (from p in datacontext.Person where p.PersonID = 1 select p) personA.name = txtName.value datacontext.savechanges() If I have to move this Update function to Service layer which only takes "Person" in the request, what would be the best w...

Best Practices for Entity Framework and ASP.NET

I've been driving myself crazy trying to get the Entity Framework to work as expected (or at least as I expect) in an ASP.NET environment, specifically dealing with objects belonging to different contexts when attempting to save to the database. What are the best practices when dealing with the Entity Framework and ASP.NET? ...

Row Level Security with Entity Framework

I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext. Some of my inital ideas have involved modifying the partial classes created by the EDMGEN tool and that has offere...

How can I force a complete load along a navigation relationship in Entity Framework?

Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship. I then used the Entity Data Model wizard to auto-generate the EDM from the database. It generated a model with the correct association. Now I ...

Is it possible to generate a database from the Entity Data Model (edmx) file?

In Linq to SQL it is possible to generate the database from the dbml file. Is it possible to generate a database from the Entity Data Model ? I wish to accomplish the same thing using the edmx file. ...

Is the Entity Framework basically another CRUD code generator?

Is entity framework just a fancy name for another CRUD code generator? Or is there more to it? ...

For what type of project is Entity Framework currently suited?

I was listening to a podcast recently that was discussing at length the short comings of Entity Framework (EF). But, their opinions may need to be taken with a grain of salt (by me), as from what I could gather: These were folks that were ORM experts. They either made their living off of ORM tools, or their hobby They were using ORM t...

What are the alternatives to using Expand in a LINQ to ADO.net Data Service Query?

I am wondering if there are any alternatives to using the Expand key word when performing an LINQ to ADO.net Data Services query. The expand method does get me the data I am interested in, but it requires me to know all of the sub-objects that I am going to be working with in advance. My absolute preference would be that those sub-obje...

Get the name of a class as a string in C#

Is there a way to take a class name and convert it to a string in C#? As part of the Entity Framework, the .Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reasons of refactoring and future code maintenance, I want to be able to have comp...

What is the best starting point on the Entity Framework from MS?

Please give me the direction of the best guidance on the Entity Framework. ...

What is the best way to use the .SaveChanges() method in ADO.Net Data Services?

Does anyone have some good information on the usage of the .SaveChanges() method? I am experiencing a variety of issues when attempting to use the .SaveChanges() method on my data context object. I am taking data from an existing data source, creating the appropriate EntityFramework/DataService objects, populating those created objects...

Entity Framework Validation

I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviosuly this is not possible in the entity framework. Is the only way to do this by handling th...

Getting started with Entity Framework in VS.NET 2008

Hi, What exactly do I need to get started with Entity Framework in VS.net 2008? I am downloading SP1 for vs.net 2008 as I type this, anything else I am missing? From what I understand I will have to create some XML and then use a .exe tool to spit out the code? ...