entity-framework

Where/when should i validate my data when using EF and POCOs?

I started a project to see what EF 4 can do with POCOs. I created a db and a custom POCO. Now i want to validate my data. For this i'm using the Enterprise Library Validation Block 5. I have no problem including the validation in my POCOs through attributes and using it with Entity Framework but this means that my POCOs wouldn't be POCO...

How do I buid a WCF Query on the fly?

I'd like to build some linq or alternatively, build a query string on the fly and pass it to a WCF Data Service (with Entity Framework data model). Something like this: public List<DocumentInformationRecord> SearchClientDocs(string clientCode, string clientName, string contactName, string groupCode, string groupName, ...

Entity Framework and Connection Pooling

I've recently started to use the Entity Framework 4.0 in my .NET 4.0 application and am curious about a few things relating to pooling. Connection pooling as I know is managed by the ADO.NET data provider, in my case that of MS SQL server. Does this apply when you instantiate a new entities context (ObjectContext), i.e. the parameterle...

How to get System.Data.EntityClient provider in Enterprise Library Configuration?

How could I get System.Data.EntityClient in Enterprise Library Configuration dropdown list for DataAccess? I want create connectionstring like below connectionString="metadata=res://*/MyNet.csdl|res://*/MyNet.ssdl|res://*/ MyNet.msl;provider=System.Data.SqlClient;provider connection string=&quot; Data Source=localhost;Initial Catalog=M...

Coding to the interface using Entity Framework

I'm trying to wrap my head around the Entity Framework and am having trouble understanding how one would code to an interface (or, perhaps, whether coding to the interface is possible). I'm fairly confident in C#, but mostly due to my ability to program in so many other languages, so forgive any ignorances. Given: public interface IInp...

How can I call sp_executesql stored procedure in entity framework?

How can I call sp_executesql stored procedure in entity framework? I need to dynamically execute formulas stored in SQL Server table column using Select Statement. I tried ENTITY SQL but it does not work. ...

Creating POCO Classes on Phasis

I create persistence ignorant classes for an existing DB which is very big and i don't want to create all classes in the beginning i want to create only classes i need and create each class when i need it. Is there any feature in Entity Framework can do this? ...

Entity Frame 4 Tiers

Hi, I'm going to use entity framework 4. I am looking to try and separate the business entity classes from the context, is this possible? I think I saw it some where, but have no idea where I saw this. I know that you have to set something in the templates. Can someone please help me on the right path? Thanks. ...

Setting Up Model Approach in Entity Framework 4

Hello, I am beginning a new project, so one of the tasks given to us is to determine whether we should create one large Entity Framework 4 model (don't know how many tables yet), or split the model into separate models, one per module within the application. If we create separate models, we'll have repeated entities within each module,...

How to model Aggregates using Entity Framework?

While I have been dealing with domain-driven design (DDD) for quite some time now, I'm relatively new to Entity Framework (EF), and one question that came to my mind when using the Entity Framework Designer in Visual Studio was how Aggregates should be represented/modeled in EF. Following DDD best practices, Entities should only referen...

Stop EF From Loading Entities When Assigning Association

Using Entity framework v4, and the POCO entity generator T4 templates. The problem I have is that the Fixup methods are loading hundreds of entities when I assign an associated entity (see line 4 below). Dim context = New SomeEntities Dim list = context.Lists.FirstOrDefault(Function(l) l.ListId = 2) Dim queryDetail = context.CreateObje...

Entity Framework Video tutorials

Are there any free video tutorials that talk about EF in depth and not just cover the basics? Thanks ...

Entity Framework - Could anybody point me to a "how entity framework actually works' site?

Could anybody provide some details on "how entity framework actually works" or point me to a web site? I dont find any somehow. ...

DLinq morphed into which one -- Linq to SQL or the Entity Framework?

What happened to Dlinq? I heard a few years ago that it was abandoned. Was some of its code used to create Linq to SQL or the ADO.NET Entity Framework? Which one? In other words, which of the two latter technologies are a new avatar of the old DLinq? I am learning ADO.NET Entity Framework and since I am just starting out, I believe th...

Unit testing entity framework

When unit testing with NHibernate I will typically have tests that create and save an object, clear the session (session.Clear()) then retrieve the object from the database. What's the equivalent of Session.Clear() with EF4? Example test: [Test] public void Can_create_and_save_a_default_account() { var account = ne...

Creating and manipulating EF1 data model in Visual Studio 2010

I'm working on a project which requires me to work with .Net Framework 3.5 SP1 and not 4. My primary tool is Visual Studio 2010. I want to use Entity Framework as my data layer (since there's a nice and quick designer to work with in Visual Studio; other ORMs don't have this privilege so you have to do it pretty much manually - code or ...

What is Linq to Entities?

There are so many terms and it is getting hard to learn the thing you are after because of the noise. Is Linq to Entities just the practice of using Linq queries against the entities generated by the ADO.NET Entity Framework? Or, is it a separate technology? If it isn't a separate technology, why does it have another confusing name as ...

Entity Framework 4 Generate Database From Model With Multiple Schemas

Hello I am using EntityFramework 4 with POCO classes, but I like to divide the database up into separate schemas. While I can do this designing the database first and then generating the model and everything works fine, if I update the model and select to generate database from model it ignores all my schemas and generates all tables un...

Dynamically add columns to Gridview using different datasource than what is bound

Tell me if this is even possible: I have a gridview bound to an ObjectDataSource providing me with data from a database. I'm filling the Objectdatasource using Linq-to-entities. Typical setup where I'm supplying the columns and rows. Below I have a horrible graphical representation. x_col x_col x_col x_row| x_data ...

Entity Framework - Eager loading related entities

I'm using Entity Framework 4 with MVC and need to ensure any referenced entities I want to use in my view have been loaded before the controller method returns, otherwise the view spits out the dreaded: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection. When selecting s...