0

I'm using the repository pattern explained here, in a Console application (just to get the feeling of how it works) and is seems i make some fundamental error.

I'm using Unity to initialize the IoC like this:

var container = new UnityContainer();
            container
                .RegisterType<Abstract.IUnitOfWork, Concrete.UnitOfWork>()
                .RegisterType<Abstract.IDatabaseFactory, Concrete.DatabaseFactory>( );

I noticed that the DatabaseFactory returns always a Database which is in a disconnected state..is that right? (I 'm focusing on using this later in a WPF application!)

I'm sure i'm missing something....

Community
  • 1
  • 1
Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53

1 Answers1

0

The IoC initialization was almost correct! The problem i got was due to the fact that i had wrongly defined a one-to-one relation. This caused insertion problems!

So i guess this matter is closed now!

Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53