unit-of-work

entity framework + repository + unit or work question

I'm thinking about starting a new project using EF 4 and going through some articles, I found an article about EF with repository pattern and unit of work (http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx) Looking at that article, it uses the ObjectContext as the...

Entity Framework with multiple edmx

Let's say I have in my database multiple db schema for example : HumanRessources and Inventory. In each of those schema contains multiple tables. Do you usually split your DB into multiple edmx or usually just put everything in one single edmx? I was thinking about creating a edmx for each schema, but wondering how this will impact a u...

Ways of implementing Unit of Work in ASP.NET MVC

I'm currently researching how to add the Unit of Work pattern to my existing ASP.NET MVC application that uses NHibernate. I'm seeing a lot of variety in the various implementations and I'm having trouble determining which methods will work best in a given situation. To help, I thought I would ask the Stack Overflow community to list t...

Appropriate lifecycle for repository classes using Castle Windsor

When I started with Windsor I thought DI would be simple. Now it's causing me more and more confusion. A repository strikes me as a class with a singleton lifecycle. I should have a single instance of a FooRepository to load and save Foos to the database during the application's lifetime. However, each repository holds a reference to a...

ASP.NET MVC/EF: How should I handle navigation properties on a new Entity?

My particular application is an ASP.NET MVC app using Entity Framework. I have an object Entity0 which contains a reference (* to 1) to Entity1... public class Entity_0 { public int ID { get; set; } public int Entity_1_ID { get; set; } public Entity_1 Entity_1 { get; set; } } I also have some logic in Entity_0, however th...

ASP.NET MVC, Ninject, single instance per request for multiple constructors

Im trying to implement an unit of work pattern by passing an unit of work instance into my repositories. Relevant code from Global.asax. public class SiteModule : NinjectModule { public override void Load() { Bind<IUnitOfWork>().To<SqlUnitOfWork>() .InRequestScope() ...

Am i using correctly Unit of Work here? (Entityi Framework 4 POCO)

I found some examples of how to create unit of work with ef4, i haven't used di/ioc and i would like to keep things simple and this an example (90% inspired) and i think it's ok but since i am looking at a pattern to use from now on i would like to ask an opinion one last time. public interface IUnitOfWork { void Save(); } publ...