Per request instance of Entity Framework db in ASP.NET with unity - entity-framework

I have an ASP.NET MVC 4 application and I need to create dbContext for Entity Framework database with a lifetime of "per request".
How can I do this with Unity container?
PS: I use dependency injection of the dbContext.

Related

How to create an instance of dbContext in Entity Framework Core Migrations?

Is it possible to create an instance of my dbContext in my Entity Framework Core migrations? Is this a supported feature? I can't seem to get an instance via Migration or MigrationBuilder

How to use Entity Framework and OData in vNext MVC

Is there any way to use Entity Framework in vNext MVC 6 (in the current release). Well, I found no option in "Add new item" of VS14 ctp and if we do manually there is some DB update problems (as i tried in earlier versions) and whats the neuget package available for Entity Framework and oData and how to use them. Please help
There is not yet support for OData in ASP.NET vNext, but there is a new version of Entity Framework: EF7. You can learn more about getting started with Entity Framework 7 here: https://github.com/aspnet/EntityFramework/wiki

Breeze WebAPI Entity Framework Self Tracking entity not working

I am in a process of developing an N-Tier solution for which I am using Entity Framework (4.X) DB first approach with ADO.Net Self Tracking entity in Repository layer. I have MVC WebAPI project and Breeze configured there. I have breeze client also configured in a seperate MVC UI project. The communication between Breeze client and server seems to work fine except that there are no Entity Ness like entityAspect object on client side after the query executes and resuls are returned.
When I change from ADO.net Self tracking entity to normal ADO.Net entity, everything seems to work fine i.e., entityAspect gets created correctly. So, just want to know if there is support in Breeze for the Self Tracking entities or not?
My Dev configs. are VS 2010 & MVC 4. I know these are bit old but client does not have license for the newer versions at the moment.

Usage of WCF RIA Services without the Entity Framework

Can WCF RIA Services be used without the Entity Framework (for example, if the datasource is no classical database)
RIA services is not tied to Entity framework. RIA services uses the provider model to make it easy to plug in other datasources.
Here is a link to an example xml provider: MSDN Custom MetaData Provider

How to auto-generate simple CRUD controllers and views in ASP.Net MVC 2 (VS2010) Entity Framework project?

I have a standard template "ASP.NET MVC 2 Web application" solution, an empty (meaning no data inserted, but with all tables etc. ready and waiting) SQL Server database, an Entity Framework 4 model (edmx). Is there a way to generate simple CRUD controllers and form views for all the entities in the model?
A buddy out there helped me with the answer - the answer is to use a "ASP.NET Dynamic Data Entities Web Application" instead of "ASP.NET MVC 2 Web Application" project template. The rest is 1-2-3-easy and is explained here: http://msdn.microsoft.com/en-us/library/cc488469.aspx
Hmm. His question was how to do this with MVC, not .NET.
I too would like to hook up and generate MVC user forms from a Sql Server schema.