I implemented IUnitOfWork for EF 4.3.1 "DbContext".

Topics: Prism v4 - WPF 4
Sep 15, 2012 at 3:09 PM

Hi,

There's 2 constructor are

1. Default constructor

public

 

partial class EverestSystemsEntities :

IUnitOfWork

{

public EverestSystemsEntities()
            : base("name=EverestSystemsEntities")
        {
            this.Configuration.LazyLoadingEnabled = false;
        }

2. Overload constructor take a parameter as string.

The String parameter is "ConnectionString" at run time. Why? this is Offline/Online.

They use Sync framework so that I have 2 database are 1. Local SQL 2. Azure SQL

public

 

partial class EverestSystemsEntities :

IUnitOfWork

{

public EverestSystemsEntities(string connstring)
            : base(connstring)
        {
            this.Configuration.LazyLoadingEnabled = true;
        }

 My Q is: How to register type with connectionString?

container.RegisterType<

 

IUnitOfWork, EverestSystemsEntities>(newContainerControlledLifetimeManager());


Sep 17, 2012 at 3:29 AM

Solved.