An ORM built by Microsoft and is available as part of .Net framework 3.5 and later.

learn more… | top users | synonyms

8
votes
3answers
5k views

Why should I use List<T> over IEnumerable<T>?

In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation. Return IEnumerable(Of Student) vs Return New List(Of ...
2
votes
2answers
573 views

Is there a better way to model a many-to-many relationship on the same table with Entity Framework?

The context We're building a web application using Entity Framework 5.0. One of the requirements is that it should be possible for the administrators to link related products so that when someone ...
0
votes
2answers
316 views

Mapping a legacy database to ORM using wrapper classes

I want to use an ORM with a legacy database, but I don't want to expose some of the underlying data types. For example, some of the columns are nullable doubles or floats and I want my domain model to ...
1
vote
2answers
282 views

What is the equivalent of Entity Framework in the world of Oracle shops? [closed]

Within the world of developers/firms specializing in building/deploying solutions built around software built/sold by Oracle (aka "Oracle houses"), what ORM middleware is considered as the "industry ...
2
votes
0answers
221 views

Entity Framework design help

I'm after some advice as to whether I'm on the right track with what I'm doing. I'm developing a WPF app where I need to retrieve a large graph of entities, work on that graph in the UI (display, ...
21
votes
7answers
3k views

Should Repositories return IQueryable?

I have been seeing a lot of projects that have repositories that return instances of IQueryable. This allows additional filters and sorting can be performed on the IQueryable by other code, which ...
3
votes
1answer
268 views

Entity Framework eager loading/reference data

I'm struggling to get my head around how best to eager load entities, and how to assign relationships when creating new entities. I'm using EF5 POCO, by the way. I'm retreiving a large hierarchy of ...
1
vote
2answers
2k views

ASP.NET MVC 4 with Entity Framework 5 and SimpleMembership integrated into Repository and Unit Of Work pattern

I have a ASP.NET MVC4 project in which I would like to use the SimpleMembership. The application has a Person table that holds relevant information about users in the system. I would like a link ...
2
votes
1answer
248 views

Is it okay to convert dataset from stored procedure to IEnumerable

So, I am working on a project with a team and we are using Entity Framework. We basically want to use linq to entities, and not use stored procedures. I use quite a bit of lists and IEnumerables and ...
5
votes
1answer
340 views

Entity Framework as a type checking/verification system for database code

When I read pro and con lists of using Entity Framework (or any modern ORM really), I'm surprised that the following point doesn't arise (self quote): Using strongly-typed domain entities allows ...
0
votes
1answer
3k views

Layered architecture using Entity Framework with different class libraries

Our business requirements required to create a layered and modular architecture. So I designed an architecture to make it as decoupled and as modular as possible. I will list my layers below ASP ...
2
votes
2answers
2k views

Is it better to create a stored procedure or entities to get to the data I need?

I just jumped into a new project with a new company using Entity Framework and ASP.NET MVC 4. I am no expert on Entity Framework, but I think I have a decent grasp of how to use it. From what I can ...
11
votes
4answers
2k views

Is a Unique ID column needed in a many-to-many (junction) table?

Getting a few projects started with EF, but I had some questions about join tables and keys etc. Lets say I have a table of applications and a table of permissions. Applications have many permissions ...
2
votes
2answers
1k views

Different database for Membership and our web data or use just one?

Is better to keep our Membership stuff on the DefaultConnection and create another connection (another database) for our data? Or just one database for all? If I have a MyAppContext and I want ...
3
votes
1answer
555 views

Where to put custom validation while using Entity Framework

I am using MVC3 and Enitty Framework 4 with the Database first approach. It created the context template with its own validation for the fields based on the database. My question is where should I put ...
5
votes
1answer
610 views

Architecture : am I doing things right?

I'm trying to use a '~classic' layered arch using .NET and Entity Framework. We are starting from a legacy database which is a little bit crappy: Inconsistent naming Unneeded views (view referencing ...
2
votes
1answer
2k views

Nesting Linq-to-Objects query within Linq-to-Entities query –what is happening under the covers?

var numbers = new int[] { 1, 2, 3, 4, 5 }; var contacts = from c in context.Contacts where c.ContactID == numbers.Max() | c.ContactID == numbers.FirstOrDefault() ...
0
votes
2answers
444 views

WCF an Entity Framework connection

I have a 100+ users on a Silverlight application that uses WCF and entity framework. Everyone has their own database and here comes my problem. How do I make sure that only the user gets access to ...
2
votes
1answer
192 views

Are elements returned by Linq-to-Entities query streamed from the DB one at the time or are they retrieved all at once?

Are elements returned by Linq-to-Entities query streamed from the database one at the time ( as they are requested ) or are they retrieved all at once: SampleContext context = new ...
2
votes
4answers
469 views

What is the most effective order to learn SQL Server, LINQ, and Entity Framework?

I am trying to get some advice on what order I should learn about SQL Server, LINQ, and Entity Framework to be able to better work with ASP.NET Webforms and MVC. From what I've been able to learn so ...
9
votes
3answers
3k views

How should I implement the repository pattern for complex object models?

Our data model has almost 200 classes that can be separated out into about a dozen functional areas. It would have been nice to use domains, but the separation isn't that clean and we can't change it. ...
6
votes
2answers
314 views

How far should an entity take care of its properties values by itself?

Let's consider the following example of a class, which is an entity that I'm using through Entity Framework. - InvoiceHeader - BilledAmount (property, decimal) - PaidAmount (property, ...
0
votes
3answers
340 views

What's wrong performing unit test against concrete implementation if your frameworks are not going to change?

First a bit of background: We are re-architecting our product suite that was written 10 years ago and served its purpose. One thing that we cannot change is the database schema as we have 500+ client ...
4
votes
1answer
533 views

Possible to switch table at runtime using Entity Framework?

I have code to switch between databases when using EF, but now also need to allow the user to choose a particular table. (The tables all use the same schema but may have different names because of the ...
7
votes
1answer
613 views

Why is the use of the STE template no longer recommended for EF5?

I was looking to upgrade my project from EF4.1/Framework 4.0 to EF5/Framework 4.5. After reading up on migrating the t4 templates for STE's (Self-Tracking Entities), I came across this link that ...
24
votes
4answers
5k views

Entity Framework with large systems - how to divide models?

I'm working with a SQL Server database with 1000+ tables, another few hundred views, and several thousand stored procedures. We are looking to start using Entity Framework for our newer projects, and ...
14
votes
5answers
9k views

Is There a Real Advantage to Generic Repository?

Was reading through some articles on the advantages of creating Generic Repositories for a new app (example). The idea seems nice because it lets me use the same repository to do several things for ...
8
votes
2answers
4k views

Dependency injection with n-tier Entity Framework solution

I am currently designing an n-tier solution which is using Entity Framework 5 (.net 4) as its data access strategy, but am concerned about how to incorporate dependency injection to make it testable / ...
1
vote
2answers
1k views

Entity Framework Joining Tables With Ranged Foreign Key Relationships

I'm not sure if "Ranged Foreign Key Relationship" is an actual term or if I just made it up, but this is what I am talking about: AgeGroup Table int MinAge { get; set; } int MaxAge { get; set; } ...
4
votes
3answers
4k views

Is Entity framework reliable enough to use in a Corporate Project? Should I use Entity? [duplicate]

Possible Duplicate: Is Entity framework reliable enough to use in a Corporate Project? Should I use Entity? I'm a junior developer who's just completed a project using Entity framework. ...
3
votes
3answers
368 views

Why should I add CHECK CONSTRAINT?

Following is a table creating script created by Entity Framework using the model shown in http://codereview.stackexchange.com/questions/14077/is-it-proper-tpt-inheritance. In this script, there are ...
6
votes
1answer
317 views

Managing Entity Framework at Enterprise Projects (with hundred of tables)

I am using Entity Framework at my work and faced some problems. Usually I hear about creating tiny Edmx´s files containing tables related to some Domain ie.: Help Desk Edmx, HR Edmx, etc. Instead of ...
1
vote
1answer
382 views

Abstraction Layer over ORM Generated Entities

I am learning LINQ to SQL (and planning to learn Entity Framework). Initially I used a abstraction layer to convert LINQ to SQL entities into a domain objects. Later I discovered the “Inheritance ...
0
votes
2answers
280 views

Will TSQL become useless because of new ORMs? [closed]

By introducing LINQ to SQL, I found myself and my .NET developer colleagues gradually moving from TSQL to C# to create queries on the database. Entity Framework made that shift almost permanent. Now ...
0
votes
3answers
313 views

Software design approach for large relational database

I am working on a personal side project that will utilize a complex and large relational database. During the design of the database I had some co-workers give advice to how I should approach my ...
1
vote
2answers
821 views

With entity framework - who needs a DAL

On EF4 actions on entities are actually done via the Business Element layer (BE). Why do I need the Data Access (DAL) on another layer?
3
votes
3answers
602 views

Proper & Efficient Structure for an entity layer?

Context Web application based on the .NET Framework written in C# and following the MVC design pattern. Question What is the most efficient way to structure an entity layer consisting on various ...
2
votes
2answers
373 views

Is it considered best practice to dynamically bind return types from the Entity context?

MyDbEntities context = new MyDbEntities(); var result = context.StoredProcedureName(userId); In the situation above, is it considered best practice to use var or ObjectResult<ComplexType>?
1
vote
3answers
2k views

How easy it is to update Entity Model from database when enough code has already been written?

I am new to Entity Framework. I know there is an option to update model from the database, but I want to know how easy and successful is this task. I may need to update my model in a few weeks but ...
3
votes
2answers
832 views

Databinding to an Entity Framework in WPF

Is it good to use databinding to Entity Framework's Entity in WPF? I created a singleton entity framework context: To have only one connection and it won't open and close all the time. So I can ...
3
votes
5answers
509 views

Using XML field Vs. creating a table for unstable organization

I am in the middle of design an application to issue and store invoices for an organization. The problem is the organization is not stable at all. There are many types of invoices and they may ...
4
votes
3answers
2k views

Unit of work principle is causing a problem in MVC3 application

I am implementing a website using MVC3, Entity Framework 4.1 and Repositoty pattern, Unit of work principle. But I am facing a big problem while implementing this. I have developed a static ...
1
vote
1answer
698 views

Entity Framework and “ViewModel”

Earlier I asked a question about "Entity Framework and layer seperation" and found out that some people use a ViewModel to show their data in the UI. For example if we got a "Person" table and an ...
9
votes
3answers
7k views

Entity Framework and layer separation

I'm trying to work a bit with Entity Framework and I got a question regarding the separation of layers. I usually use the UI -> BLL -> DAL approach and I'm wondering how to use EF here. My DAL would ...
5
votes
3answers
3k views

DDD with ORM where should the business logic go?

I have used an MDA (model driven architecture) tool in the past where we modeled via UML and this generated the business entities (our domain model) and the ORM (mapping etc) amongst other things. A ...
5
votes
1answer
10k views

Entity Framework vs. Linq to SQL? [closed]

I'm a little bit confused about these two terms "Linq to SQL" and "Entity Framework". I have the general idea that both of them somehow allow you to refer to database tables as .net objects or ...
6
votes
4answers
542 views

Does EF mean you might never have to use SQL or design database tables again?

Does Entity Framework mean you might never have to use SQL or design database tables again? Is this what "persistence ignorance" means? I am new to EF and ORMs in general, and I would like to ...
7
votes
5answers
3k views

Should we bind view to a model property or ViewModel should have it's own..?

I am starting a project with following technical environment : .Net 4.0, Entity Framework 4.0, WPF with MVVM Architecture I saw lots of examples on the net, some books with this environment. In some ...
3
votes
1answer
405 views

ASP.NET MVC - should the MVC's M, V and C be explicitly aware of domain entities?

Since this question seems to be pretty subjective, I'm posting it here. Let's say you're writing your own version of Stackoverflow using ASP.NET MVC, so there are classes like Question, Answer, User, ...
3
votes
2answers
907 views

Organizing your Data Access Layer

I am using Entity Framework as my ORM in an ASP.Net application. I have my database already created so ended up generating the entity model from it. What is a good way to organize files/classes in the ...