The ADO.NET Entity Framework version 5, containing support for .net 4.5
2
votes
2answers
411 views
Looking for a Ninject scope that behaves like InRequestScope
On my service layer I have injected an UnitOfWork and 2 repositories in the constructor. The Unit of Work and repository have an instance of a DbContext I want to share between the two of them. How ...
57
votes
6answers
2k views
How to “warm-up” Entity Framework? When does it get “cold”?
No, the answer to my second question is not the winter.
Preface:
I've been doing a lot of research on Entity Framework recently and something that keeps bothering me is its performance when the ...
30
votes
6answers
11k views
Entity Framework Code First: decimal precision and scale
I'm experimenting with this code-first approach, but I'm find out now that a property of type System.Decimal gets mapped to a sql column of type decimal(18, 0).
How do I set the precision of the ...
3
votes
1answer
190 views
How I can read EF DbContext metadata programmatically?
I have application which uses EF-CodeFirst 5 (dll ver 4.4.0.0, on .net 4.0).
I need to be able to read entity metadata, so that I can, for a given entry type get following information:
which ...
1
vote
1answer
90 views
Is adding a class that inherits from something a violation of the solid principles if it changes the behavior of code?
I struggled to enable my code to run code first EF migrations using different connection strings, and finally got it working.
The method I used is outlined in my answer to this question
What bothers ...
5
votes
1answer
4k views
Entity Framework Code First Using Guid as Identity with another Identity Column
a.k.a How can we create multiple identity columns in Code First?
Because of clustering performance, a common recommendation is to use an autoincremented integer column instead of a GUID created with ...
6
votes
2answers
5k views
Entity Framework 5 update model from database does not generate table class [closed]
I am using EF5 in VS2012, database first method.
When I add a new table X to the design surface, the table shows, then I save and compile without error. However, no class X is ever generated (under ...
1
vote
1answer
92 views
Return column based on record in FK table
I have a success query for displaying Vendors, but what I wanted to add now is a column showing which vendors have been selected or not (displayed as a checkbox column). These selections are stored in ...
1
vote
1answer
1k views
Why my super simple ASP.NET Web API (mvc4)+Entity Framework 5 doesn't work?
I spent days to know the problems of my work, but no luck.
I created new MVC4 Web API project.
Add EF5 with my database (Project>Add>ADO.NET Entity Data Model>Create from database which is in Azure ...
0
votes
1answer
59 views
How check by unit test that properties mark as computed in ORM model?
I'm created ORM by Entity Framework 5.0 (C# 4.5) - database first.
Some properties of entities i'm marked as computed (binded to columns with defaults).
How check by unit test that properties mark ...
7
votes
1answer
2k views
Can I store enums as strings in EF 5?
We have been using EF CF for a while in our solution. Big fans! Up to this point, we've been using a hack to support enums (creating an extra field on the model; ignore the enum durring mapping; and ...
13
votes
1answer
4k views
'Enable-Migrations' fails after upgrading to .NET 4.5 and EF 5
I just upgraded my MVC4 project to .NET 4.5 and EF5 and started using VS2012.
After realizing I needed to set-up auto-migrations in the Package Manager again I ran Enable-Migrations - ...
6
votes
2answers
4k views
Does Entity Framework 5 support unique constraints?
Wondering if Entity Framework 5 supports unique constraints on entity properties? If so, how can I specify that a property should be unique?
1
vote
1answer
210 views
Programmatic data transformation in EF5 Code First migration
Is it possible to do any type of programmatic data transformation in Entity Framework 5 Code First migrations?
There is an Sql() method to execute queries, but it has return type void and I don't see ...
0
votes
2answers
92 views
Migration does not alter my table
I just enabled migrations in my project and added a few fields to UserProfile:
[Table("UserProfile")]
public class UserProfile
{
[Key]
...