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

learn more… | top users | synonyms

2
votes
1answer
146 views

Should you reuse an Entity Framework EDMX between multiple solutions?

We currently have 1 giant EDMX for our corporate database. It, along with all of the generated POCOs, are in a separate project (we'll call it the EDMX project) which we pull in to any solution that ...
0
votes
0answers
31 views

Row and Field level Security Management through Code First EF, WebApi2

I could not find such question specific to asp.net webapi row level security on SO. I am building an API through .NET Webapi2 with Entity Framework. I am trying to assess various options that are ...
3
votes
2answers
403 views

Should an ASP.NET MVC application directly use Entity Framework as the model?

I'm building my first MVC application in Visual Studio 2013 (MVC 5) and I'm a bit unclear on the best way to setup my model. I've generated an entity framework model using code-first from an existing ...
2
votes
2answers
144 views

How do I write my BLL to make it re-usable?

Most of it was written 4-5 years ago. Our teams long term objectives are to use Entity Framework. Though we aren't gonna do it right away as our deadlines aren't allowing us to do so. Now we have our ...
0
votes
2answers
88 views

Is a mocking framework useful if I'm unit testing a repository/database? [duplicate]

I'm trying to improve my testing skills. I frequently hear about mocking framework to build fake objects (as far as I understand). Right now I need to test my repository (the usual add, remove, update ...
0
votes
0answers
26 views

Proper Architecture for DBContext and Migrations with Multiple Projects

I have multiple projects that will be using the same business objects (customer, order) but the projects operate in different databases within the organization and I would like to understand the ...
4
votes
1answer
203 views

Repository Pattern: Exposing Data Context to Underlying Layers

My team is in the process of updating a legacy project. We've decided to incorporate the Repository Pattern along with Entity Framework in our Data Access layer. Below is a high-level view of this ...
1
vote
4answers
134 views

Is DDD not appropriate for my website or should I introduce a Query Layer?

I have inherited an ASP.NET website application and the previous developer has used what I believe are some DDD concepts. I am new to DDD and I have to admit I am struggling with the practical side of ...
1
vote
1answer
224 views

What are the benefits of using entity framework code-first instead of designing my database using SQL?

I'm currently working on designing a small web application (MVC5) and I'm to the point of designing my database. I have the schema I want worked out and I am quite proficient in SQL Server. (I have my ...
2
votes
2answers
75 views

Communication/Updates between units of works/entity framework contexts, colliding with user changes

I'm developing a WPF application using Entity Framework for my database communication. The application has a hierarchy of tabs where each tab has a db context. Each tab allows the user to view some ...
2
votes
2answers
561 views

How to model users accounts in ASP MVC Framework with Entity Framework using code-first approach?

How do you design your code-first approach in entity framework when your code should include user data (name, password...) without repeating/overwriting what the MVC framework will generate in terms ...
2
votes
1answer
55 views

Using json as database with EF, how can I link EF and the json file during DbContext initialization?

For a personal testing-project I am considering to create a SPA with the following technologies: ASP.NET MVC + EF + WebAPI + AngularJS. The project will make use of small amount of data, so I was ...
1
vote
0answers
119 views

What strategy to follow while matching sql server datatypes in C# Code First approach while using Entity Framework

While matching SQL Server datatypes with C# Code First Approach in Entity Framework, what are specific points that we should keep in mind so that our C# datatype should match exactly our SQL Server ...
1
vote
1answer
55 views

Is table inheritance the wrong approach

If we take the two below entities as en example. public class Person { public string Username {get;set;} public string DisplayName {get;set;} } public class Worker:Person { public string ...
4
votes
2answers
159 views

Entity Framework with no direct table access

There are some similar questions I've found here, but none of them fully answer the question I'm asking. Similar questions: here and here In my company, I develop C# .NET applications and our Server ...
1
vote
2answers
171 views

Is it faster to query using linq-to-entities or a data adapter?

I'm creating an MVC application in VS2012 and I reverse-engineered the models from existing Oracle tables. The tables are part of a MASSIVE database. Besides the main tables that I need to insert, ...
0
votes
1answer
77 views

I recently read about unit of work and repository design patterns; working with EF wondering if this is a good design pattern

I found myself creating child records that require a master record to exist, first, so that they can reference it by the master record's primary key (if that's the right term). To accomplish this ...
1
vote
2answers
103 views

How far can I drift from my original domain model and still have the benefits of an ORM?

I have the following domain models: public class User { public int Id { get; set; } public ICollection<Product> Products { get; set; } } public class Product { public int Id { ...
0
votes
1answer
303 views

Confused on how to properly employ a Repository Pattern with Service/Business Layer on top

I'm building a ASP.NET Web Api 2 solution for learning purposes, and I've hit a snag. I was wondering if anyone could tell me what exactly it is that I'm missing. My Web Api solution has 4 Layers: ...
1
vote
1answer
232 views

Repository Pattern: Doctrine2 vs Microsoft Entity Framework?

I have been using Symfony2 with Doctrine2 for some years. I have recently started using Microsoft's Entity Framework with MVC5. From my Symfony2 experience I understand that a repository's job is only ...
1
vote
0answers
46 views

Is it improper to have an application wide source for dropdown binding

The WPF Combobox needs to bind a collection to it's ItemsSource and something to bind the selected item or value to. Until now, I've included both the collection and the selected value properties that ...
0
votes
1answer
127 views

Entity Framework 6 Conventions

I use the Entity Framework often, but I have one area of confusion I would like to understand better. If I wanted to have a navigation property in an Entity such as public virtual ExampleObject ...
0
votes
0answers
244 views

What's the best way to expose a Model object in a ViewModel?

In a WPF MVVM application, I exposed my model object into my viewModel by creating an instance of Model class (which cause dependency) into ViewModel. Instead of creating separate VM properties, I ...
3
votes
1answer
172 views

Why DbContext object shouldn't be referred in Service Layer?

I've been looking for some implementations of Service Layer and Controller interaction in blogs and in some open source projects. All of them seem to refer DbContext object in repository classes but ...
1
vote
2answers
463 views

Correct way to inject dependencies in Business logic service?

Currently the structure of my application is as below Web App --> WCF Service (just a facade) --> Business Logic Services --> Repository -> Entity Framework Datacontext Now each of my Business logic ...
0
votes
2answers
411 views

In what situation do Entity Framework enums become useful?

I am working on a project where there will be plenty of static options being stored in the database. I looked at using Enums for this, but do not see how they could be useful. They do not create any ...
1
vote
1answer
447 views

entity framework 6 agnostic enough different sql server and OS platforms?

It's my first time using sql server, I usually go with MySQL, so I'm unsure how to do this. The project I'm assigned will be deployed to multiple platforms particularly PC's with different SQL server ...
2
votes
0answers
415 views

Entity Framework - Loading Related Entities Explicitly

I have been using Entity Framework for a few years. I have flip-flopped between calling out to repositories in my business logic or using lazy loading to retrieve data as I work my way through the ...
-3
votes
1answer
262 views

Entity/Collection change tracking by DbContext [closed]

Can someone explain me how entity changes and entity collection changes are tracked by DbContext in Entity Framework 6 where entities are POCO type (not derived from EntityObject)? I experimented with ...
2
votes
5answers
300 views

Create Database To Fit Data vs Make Data Fit The Database

I'm newish to programming and would like to know what people have found to be the most supportable option or rather what people find more understandable. I'm the only one writing code at my firm, but ...
2
votes
4answers
228 views

At what point does data access\manipulation logic becomes business logic?

Consider a service which updates PersonDetail tables in database. I am Using EF which maps the table to this Entity. When a record is updated, it is not actually updated but a new record is created ...
0
votes
2answers
715 views

How to connect mvc application using entityframework or ado.net?

I am an ASP.NET developer. I want to learn ASP.NET MVC. In fact I am learning it. But Now I am confused at a point. How can I connect my database to my application. Using entity framework or linq or ...
0
votes
0answers
152 views

How to handle field level Acces Security when using Entity Framework

Scenario: a large existing system (~300 tables, 500 stored procs, 200 views and a code base of several 100k lines) with most security level stuff in stored procedures needs to be refactored (for ...
2
votes
1answer
256 views

Would this be a correct way to use the Repository pattern in ASP .NET MVC application implementing Entity Framework?

This ASP .NET MVC application implements Entity Framework. I've declared the repositories in the DbContext like this: public class CompanyDbContext : DbContext { // constructor goes here ...
4
votes
4answers
3k views

How to get around the Circular Reference issue with JSON and Entity

I have been experimenting with creating a website that leverages MVC with JSON for my presentation layer and Entity framework for data model/database. My Issue comes into play with serializing my ...
1
vote
1answer
382 views

How to use Git with ASP MVC Code-First Entity Framework [closed]

TLDR: What is an effective way to use Git to handle ASP MVC code-first EF? Which files need to be included for NuGet? Which files should be left out? We have an ASP MVC code-first Entity Framework ...
1
vote
3answers
212 views

Should entities be accessible from all layers of an application? [closed]

I am googling this issue now for weeks, but cannot find a good discussion. It boils down to this: As POCO entities used in a dbContext are in fact a definition of the database, shouldn't they be ...
0
votes
0answers
66 views

IUserType like feature inEntity Framework

I'm working on a new project, we want to build a new, modern, application working with our legacy data sources, and especially, legacy databases. We want to use an ORM and we want advanced features so ...
2
votes
1answer
681 views

How to split up ASP MVC Project using Code-First Entity Framework

For an academic exercise, we have been tasked with creating a small website. We have already gathered the requirements and fleshed out the business domain to see the classes we are supposed to ...
1
vote
1answer
1k views

What are the disconnected scenarios in Entity Framework?

I'm not sure I understand what all fall under the disconnected context scenarios in EF (See this and this). This link says use Web API or WCF services to avoid the complexities of disconnected tier EF ...
0
votes
2answers
247 views

How do I read the Entity Framework Model and validate it against a given connection?

I have a Entity Framework Database First Model. I want to write a MSTest/nUnit test to verify that all the stored procs, tables and views that are defined in my edmx model are still valid on the ...
1
vote
1answer
270 views

How do I architect zip code & distance calculation functionality?

I am building an app using MVC 4/Razor and EF 4/ .NET 4 in which it is possible to search items by zip code and thus retrieving items only a certain distance from your current zip code. I have a class ...
0
votes
1answer
120 views

Inheritance with Entity Framework Code First

I'm starting work on a new personal project and I'm looking to get advice in regards to setting up my classes. My base class is a User. The User class will have the following general properties ...
1
vote
2answers
123 views

Should db be mapped directly to the UI or should there be multiple layers of enties/models with mappings to/from each?

I would like to know arguments for/against this concept. Technologies in use from the bottom up: MSSQL 2012 DB (exclusively accessed via sprocs) Entity Framework WCF Web Service ASP.NET Webforms ...
1
vote
2answers
491 views

What is right choice of Data Access Layer for large application

I am using Singleton pattern for my application, I have used ADO.NET Entity framework as my Data Access Layer, after login to my application, it's taking 3 to 5 minutes to load the dashboard. Is ...
1
vote
1answer
3k views

DbFirst vs Code First? what should I use if I rely on Stored procedures

This question is asked many times, and I always prefer code-first as I like to keep the logic in code. But now I have a challenge to load screen under 5 seconds and very little time to do things. I ...
9
votes
3answers
2k views

Entity Framework Entities - Some Data From Web Service - Best Architecture?

We are currently using Entity Framework as an ORM across a few web applications, and until now, it has suited us well as all our data is stored in a single database. We are using the repository ...
0
votes
1answer
161 views

Are there any concerns with using a static read-only unit of work so that it behaves like a cache?

Related question: How do I cache data that rarely changes? I'm making an ASP.NET MVC4 application. On every request the security details about the user will need to be checked with the ...
2
votes
3answers
2k views

How do I cache data that rarely changes?

In my ASP.NET application there is some data that doesn't change often and so there is no point in querying the database to re-check it every time. In my current situation I am checking user ...
1
vote
1answer
490 views

Entity framework and Eager loading and enterprise application with DDD aproach

We are trying to create an ASP.NET MVC 4 application using entity framework with domain driven development style pattern approach. As you can see in our part of domain layer, we have a complex design. ...