DelRepo - Problem using GetAll Method in my own Solution

Apr 21, 2011 at 2:04 PM

Hello,

 

I'm trying to use the GetAll Method from DelRepo, but it throws this exception in the method Resolve of the IoC class :

No component for supporting the service Core.Repository.IDelRepo`1[[Core.Model.Offers, MarteloFacil.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] was found

 

Someone knows what is happening?


Thanks

 



        
    
Coordinator
Apr 21, 2011 at 5:06 PM

it looks like in your solution IDelRepo doesn't has an implementation registered

Apr 21, 2011 at 8:13 PM

When I use this, it works:

var delRep = new DelRepo<MyEntities>(new DbContextFactory());
 
            List<MyEntities> lst2 = delRep.GetAll().ToList();
 

But, when I use directy, in the GetAll method has the following code:
 if (typeof(IDel).IsAssignableFrom(typeof(T)))
                return IoC.Resolve<IDelRepo<T>>().GetAll();
            return c.Set<T>();

 

But it doesn't work.

Coordinator
Apr 21, 2011 at 8:52 PM

IDelRepo must be registered to DelRepo

I do this in WinsdorConfigurator class when I call:

WindsorRegistrar.RegisterAllFromAssemblies("Omu.ProDinner.Data");

the assembly gets scanned and it find DelRepo that implements IDelRepo and it gets registered automatically
Apr 26, 2011 at 12:27 PM

Thanks you! I've tested and worked.