The ADO.NET Entity Framework is a set of ORM (Object-Relational-Mapping) tools for the .NET Framework, since version 3.5 SP1.

learn more… | top users | synonyms

0
votes
0answers
19 views

DbManager helper class for Entity Framework [on hold]

I'm trying to do a generic Db cotext helper\manager so I can use it as a dll in many projects with different data bases. I tried to use it with one of my projects but I got confused with the attach ...
0
votes
0answers
11 views

Multi layer architecture with integration with third party web sites [on hold]

We have been designing an application with the following architecture. Can anyone please review and give suggestion to improve it. An EndUser Portal will be used by the end users. An Admin Portal ...
2
votes
1answer
34 views

Can this method be changed to remove all objects in one call?

I am converting a VB.NET app over to C#. I won't subject you to the old code but the following is done in a little over 100 lines using nested loops. I am using Entity Framework 6 as my ORM. I have ...
-1
votes
0answers
23 views

Representing a relationship between three entities [on hold]

I have the following relationship. Please suggest any better way of representing the following bidirectional reference: ...
0
votes
0answers
14 views

Deep loading data - MVC / Entity Framework / Repository Pattern [closed]

I am implementing an ASP.NET MVC 5 web app using ASP.NET Identity 2 and Troy Goode's PagedList. I need to display UserRole data in the following format in a JqGrid: User Name | Role Name This ...
3
votes
1answer
51 views

Data model for tracking currency in a safe [closed]

I am attempting to design an application that tracks currency and recent transactions in a safe. I am using entity-framework code-first in a wpf desktop application. The first goal is to be able to ...
2
votes
1answer
67 views

Is there better way to shorten this Lambda expression's result selector?

I'm new in LINQ and Lambda expression. I'm not sure is there a way to shorten the result on this o.z.cust.cust.cust.bintAccountNo. As you can see below, the more ...
10
votes
2answers
161 views

Do I need ninject when implementing DAL with generic repository and unit of work?

I am implementing generic repository and unit of work for the first time. I would be glad if someone can correct me if I am doing something wrong here. This is how I communicate with my DAL from ...
1
vote
1answer
44 views

Concept for saving context information

My Problem I have a library containing business logic which is being used from 3 different projects: Website Local WPF Application WCF Service The library uses Entity Framework and a connection ...
7
votes
4answers
408 views

Basic Entity Framework Repository implementation

Here is simple repository pattern that I use to access data in my database. I would like some advice on how to improve this code. Commenting on my code quality is also welcome too! ...
1
vote
1answer
43 views

Update multiple records with Entity Framwork

I am wondering what the best way to update multiple records with Entity Framework is. This is how I normally do it, and it does work: ...
3
votes
1answer
60 views

Entity Framework - updating two different arrays of child associations

Exercises have Muscles and Tools. When someone adds or updates an ...
8
votes
1answer
164 views

EF6-Lambda Expressions deep big-tree query

I am looking to improve the following query. We are using EF6 (CodeFirst) and C# Lambda Expressions, and Repository/Unit of Work patterns. Also, we needed to restrict the query in a way that we ...
2
votes
4answers
333 views

Silent Try_catch in high load socket server or not?

I'm working on a socket application that will listen to incoming messages from about 400 devices. They all send a message at least once per minute. Now I have a working program and it has been running ...
5
votes
1answer
56 views

EF query for calculating monthly trends

My application has a fairly important query that is used in a lot of places. Unfortunately it takes about 14 seconds to run, so I'd like to find a way of possibly improving it. The application ...
1
vote
1answer
40 views

Refactor Oracle Entity Framework lambda query

I had a ugly problem and wrote an ugly query. Query creates a cache that is used to get person id when I have {full_name, id_code?, birth_date?}. By question mark I mean that it is perfectly valid ...
5
votes
2answers
220 views

Static Data Helper for an Oracle Backend

What I would like to do is have a method call like: ...
3
votes
1answer
75 views

Method to save child objects

I'm using Entity Framework 6 with database first. See the image for the relevant database schema I have the following method to save a Set to the database: ...
0
votes
0answers
50 views

WebApi synchronize database (EF 6) access

I'm working on an ASP.Net MVC 5 /WebApi 2 project. I'm using EF 6 code first for my database access. I've a WebApi action method in which I've to update some data in my database based on the request. ...
5
votes
1answer
60 views

Work around for EF6 bug 1748 in the Entity Framework

Entity Framework 6 fails to handle the maintenance of LocalDB's global list of databases. That is noted here: Application fails when attached mdf and ldf files are deleted Here is my code to work ...
6
votes
1answer
129 views

Refactoring a LINQ query that (sometimes) returns null

I have the following LINQ query that should return a result for each Request. I'd prefer to have the query translated to ...
1
vote
1answer
122 views

Multi threading in ASP.Net to increase performance of processing data from entity framework using anonymous types

Intro I am trying to populate a Multi-column Combo-box with a large amount of records.Depending on the selection the user has taken there can be 1 - 50000 items in the Combo-box (I may not display ...
4
votes
1answer
71 views

Insert Model object effectively using entity framwork

I have a WPF MVVM Application. I have a Customer Model which is generated by an entity framework (Database first approach) and one CustomerViewModel where I ...
2
votes
1answer
84 views

BaseRepository for EF6 - updated

Previous question: BaseRepository for EF6 I've update my code. Is it correct now? I've changed IEnumerable to IQueryable. ...
8
votes
6answers
358 views

BaseRepository for EF6

Is this okay? ...
2
votes
1answer
57 views

Making the objectContext.CommandTimeout configurable?

I am trying to make the CommandTimeout value more configurable. I'm wondering if this is best practice to do so? I add the following to my <appsettings> ...
3
votes
3answers
267 views

Entity Framework with multiple connections open?

I'm learning Entity Framework and I'm wondering if this code is the proper way of doing this. Basically this is my attempt at refactoring a very long controller in ASP.Net MVC 4. I'm using Entity ...
2
votes
1answer
101 views

Seperating Entity Framework into BLL

I have an Entity Framework working with a SQL database. A Web Forms application is currently communicating directly with the Entity Framework model from code behind. I have been tasked with creating a ...
4
votes
1answer
98 views

Saving a sales order - too many repositories?

I am wondering if I have overdone it with repositories in the following code, which is to save a sales order. I understand that the purpose of a repository is to decouple the domain layer from the ...
2
votes
1answer
69 views

Compare Collection with the information in DB using EF and LINQ

I want to inform the Receivers about new contracts we have this week. After I sent the Emails, the Information about sent contracts are stored in MS SQL Database. To avoid that someone become the ...
4
votes
1answer
136 views

EntityFramework-based filtering

I am trying to use the following form to enter new info into a database. I am trying to use the entity framework. I have the following classes of Interest: ...
2
votes
1answer
121 views

Parent/child relationships: adding/updating details to an answer

Answer is the Parent table and AnswerDetail is the child. Below works, but I'm wondering if there is a better way to do this using EF? My Method Signature is this: ...
5
votes
2answers
192 views

Getting list of daily team goals

The old code I had before was atrociously slow but after some advice and research I was able to take a 2-5 minutes run time down to about 5-30 seconds. That is acceptable, but still looking to have ...
5
votes
3answers
171 views

Calculating total sales from each member

I am building a new system that is using some tables from an old system. For each user on this new system, I need to go to the old system and total up their sales. Currently it takes between 2-5 ...
4
votes
1answer
97 views

Am I even using the Entity Frameowrk and/or LINQ the way it is supposed to be used?

I feel like just because the below works doesn't mean it is correct, I want to improve it but I can't really figure out how. Besides the fact it is down right ugly I feel the performance could be ...
7
votes
2answers
1k views

Unit of Work and Repository with Entity framework 6

Based on the reply of this question I have created the following code. I need to check whether it's good or not. Here is my entity class: ...
4
votes
1answer
491 views

Database first entity framework, repository, service, UnitOfWork pattern

I have seperated my project into two projects. One is the web forms project and the other is the Model project with contains a generic repository implementation, a service class for each of my ...
2
votes
2answers
79 views

Add chat to an MVC database: Can I condense this code and is it appropriately placed?

I have these relevant tables in an MVC website: Server ServerPlayer ServerPlayerChat Servers have serverPlayers, ServerPlayers have ServerPlayerChats. Simple enough and expectable. I'm using ...
1
vote
1answer
72 views

Group By And Two Counts

I'd like to know if there's any better way to write this query: ...
4
votes
2answers
87 views

Retrieve Tasks by Employee

I think I've done a decent job keeping this query simple and understandable, but I'd like to know if you have some more advice. My relevant entities are defined like this: ...
7
votes
1answer
480 views

MVC 5 & EF 6 - Repository & Unit of Work Pattern

I have been looking through Code Review on the subject of Unit of Work and Repository patterns and realised that my implementation appears to provide very similar functionality but in reverse class ...
4
votes
1answer
130 views

Using static management class to control db transactions through an EF6

I have the class below to manage my specific implementation of a membership system using entity framework 6.1 Is the use of static access correct in this case? as far as I understood that EF context ...
5
votes
2answers
311 views

Entity Framework Skip and Take too slow

The following code achieves what I require, reading 10000 rows at a time: var query = repository.Subscribers.ToList().Skip(numberToSkip).Take(numberInBatch); Is ...
5
votes
1answer
286 views

Model Design for MVC4 Applications using Entity Framework Code First

I would like to put the following design to your consideration. This is the pattern I use to follow when I'm building a Model and Data Access Layer for an MVC Application (using Entity Framework 5). ...
3
votes
1answer
138 views

Implementing the Repository Pattern

I'm new to this pattern and I see arguments online about different implementations. I have the following code and it seems fine to me, but I'm wondering if having to pass the DBContext into the ...
4
votes
1answer
136 views

Verifying the Entity Data Model schema against a production database

We have an entity data model (database first) for a legacy product we are migrating to .Net from Delphi. We recently deployed to a server where some of the tables had been modified and columns ...
1
vote
1answer
90 views

Class to Return Single Integer

I have a class used to return a single integer, but think there is room for improvement. The class should only return a single row every time and if no row is found it might be a good idea to throw an ...
2
votes
0answers
176 views

Generic Repository, UnitOfWork and IOC container

I am stuck to define a generic repository with AutoFac IOC container. I am keeping thing very simple and only showing relevent information. I have a BaseEntity ...
4
votes
1answer
66 views

Should I create two seperate Services and then combine them or have one large?

Basically, I have two separate tables, Campaign and CampaignDetails. They relate via CampaignID. I want a service that can handle both at the same time, as they're closely related and when one gets ...
2
votes
0answers
106 views

Domain modelling with Repository [closed]

I've been struggling with some architectural problems which I'm having a hard time figuring out myself. Im trying to construct a basic structure of a project with the domain model and repository ...