Tagged Questions

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
10 views

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

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, ...
5
votes
2answers
160 views

How to reduce my code length without changing concept?

There are three servers. I want to assign a job to a server which has least NotStarted jobs. I have achieved this, but my code is very lengthy. I don't know how to minimize my code without changing my ...
4
votes
0answers
103 views

Multiple repository calls or LINQ query

These two methods do the exact same thing (or at least they are supposed to!). They both pass a simple test based on a mock context. Neither has been exposed to any integrated testing yet. Would ...
4
votes
2answers
126 views

Threadsafe DBContext in singleton

I found out the hardway that access to DbContext in .NET is not threadsafe. I have a singleton for logging things using a dbcontext. The original version uses something like public Logger{ private ...
3
votes
1answer
502 views

Generic repository and unit of work code

I am writing a WPF application that needs to access information from a database (I am currently using Entity Framework code first, so data access is via DbContext). My ViewModels directly ...
0
votes
1answer
81 views

Is it proper TPT Inheritance

I have following model and database created using Entity Framework. Is it proper TPT Inheritance? Is it possible to make the base class as abstract? Model Database CODE namespace LijosEF { ...
1
vote
2answers
293 views

Many to many crud using entity framework 4.1

My view submits data to the controller using Json objects which contains child objects.It allows users to add/remove/modify the relationship with child entities(authors,categories,LIbraryBookCopy). ...
1
vote
0answers
217 views

Linq-to-entities query too slow

I am fairly new to Entity Framework and I am not sure I am really using it to it's max potential. I have this query, that IMHO seems to take a little longer than I feel it should. I have tried ...
2
votes
1answer
274 views

Your Thoughts: Entity Framework Data Context via a DataHelper class (centralized context and transactions)

I want to get opinions on the code I have put together for a centralized DataContext via a DataHelper class that I have created to be re-used on projects. NOTE - there is a ton of code here, sorry ...
2
votes
1answer
229 views

IAuditable and IArchivable Repository with Repository Pattern and UnitOfWork

I am quite new to ASP.net and am currently trying to implement my data access layers of my application. I have so far implemented a generic repository pattern as follows: using System; using ...
1
vote
1answer
95 views

How could I remove repetition from this linq-to-entities query?

This linq query works, and it does what I want it to do, but is there any other way I could improve the query so I'm not repeating a.AnswerRevisions.OrderByDescending(r => ...
5
votes
1answer
172 views

LINQ Compare Query Improvements?

I'm attempting to create a compare table to compare products depending on the add-ons they have. To grab the data and filter it I'm using LINQ To SQL. Table's Layout (Cut short): Products Table ID ...
1
vote
0answers
103 views

Is my MergeUtility good enough to create an open source project out of?

Here is a utility that supports ETL/merging in EntityFramework. If it's not appealing as a general purpose tool, why? If it is appealing as a general purpose tool, how might the design be made ...
2
votes
1answer
140 views

Clever way to build a extension method that ordenate my IQueryable<T>?

I want to create a ExtensionMethod to ordenate my linq query, called Ordenar. I'll sort it depending what columns is in sortColumns ListDictionary. I tried some ways, but the best way I arquieve was ...
2
votes
2answers
130 views

Can someone tell me if I'm barking up the wrong tree with this ASP.Net MVC/Entity Framework pattern?

So I have experience is C#/ASP.Net, and I've done MVC in Ruby On Rails, so I figured making the jump to ASP.Net MVC would be a breeze. Unfortunately, I'm second guessing my every descision. I'd like ...

1 2 3
15 30 50 per page