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

learn more… | top users | synonyms

0
votes
0answers
38 views

Entity Framework and separating DAL from domain entities

If I have a normalized db, it's unlikely to map 1 to 1 with my domain entities. So I customize my EF entities to fit the domain. But now my EF entities are essentially my domain entities and my DAL is ...
-1
votes
0answers
37 views

how to convert system.linq.IQueryable<int?> to int?[] [migrated]

foreach (var app in allList) { int?[] ids = Context.tblTransactionDetails .Where(x => x.IsActive == true) .Select(x => x.AdvertID); }
0
votes
2answers
174 views

Bad Practice using Auto Generated Classes for Data Access

I've seen this before but haven't found concrete reasons. When you add Entities to your EF model, EF auto generates classes for these entities. In terms of DataAccess, why is it preferred to not ...
0
votes
0answers
42 views

MVC Sites and Entity Framework (using DbContext)

I've been looking at a couple of the MVC tutorials on the ASP.NET website and and have noticed numerous of them make use of Entity Framework (especially the Identity provider stuff). Maybe my ...
0
votes
0answers
33 views

Entity Framework Lookup Tables

I am coming from working with ADO.net DataSets and feel fairly comfortable with how they work. Mainly, I usually have a DATA table with a large number of REF tables for lookups. In DataSets it was ...
2
votes
1answer
51 views

How to represent an optional-to-optional relationship in a database

I have two types of users: a CRM user and a system user. We have a record of every CRM user, thanks to a nightly sync that we run (so we don't have to hit the CRM API every time). We have system users ...
0
votes
1answer
69 views

Inverse property naming (ORM scenario) [closed]

I have a class that represents a process. In this process there are inputs boxes and output boxes. public class Process { public long ProcessId { get; set; } public virtual List<Box> ...
0
votes
0answers
39 views

How can I control the naming used when mapping foreign keys where there are more than one list of same class contained [migrated]

public class Person { [Key] public int ID { get; private set; } [Required] [StringLength(100)] public string PersonName { get; set; } } Creates "People" table ID | PersonName | ...
0
votes
1answer
87 views

Using Code First concept of Entity Framework in production

I'm developing an application and I have a database with it using Entity Framework Code First concept. I like this approach very much. I'm using the latest version of EF which is 6.1.1. My main ...
1
vote
1answer
85 views

Controller / Service - Should a service save changes to the database

I have an action on my controller called DeleteLine. This removes a line from the users basket. My controller action looks like this: [HttpGet] public ActionResult DeleteLine(int orderId, int ...
1
vote
0answers
70 views

Entity Framework Code First Centralized database deployment

I originally posted this on stack overflow but was told that here is a better place to ask this kinda stuff. I couldn't find any other similar answered question but if there is one please give me a ...
3
votes
1answer
209 views

How to store a potentially large amount of optional properties of objects?

I'm using Entity Framework Code First with ASP.NET MVC. This handles my database design based on the domain models within my application. As it stands, the engine I'm writing will have a website ...
2
votes
1answer
239 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
75 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
1k 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
150 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
131 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
52 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
327 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
206 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 ...
2
votes
1answer
749 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
106 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
1k 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
77 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
128 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
79 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
233 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
299 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
83 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
105 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 { ...
1
vote
1answer
419 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
2answers
369 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
70 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
130 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
320 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
234 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
484 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
644 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 ...
2
votes
1answer
634 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
480 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 ...
2
votes
5answers
315 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
234 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
935 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
176 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
274 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
5k 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
468 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
243 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
68 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
747 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 ...