views:

29

answers:

1

I just configured Castle-Windsor and am receiving this message:

Type DataModel.IDepartmentRepository is abstract. As such, it is not possible to instansiate it as implementation of DataModel.IDepartmentRepository service.

My Interface looks like this:

namespace DataModel  
{  
    public interface IDepartmentRepository  
    {  
        IQueryable<Department> GetAllDepartments();  
        Department GetDepartment(int id);  
        void Add(Department department);  
        void Delete(Department department);  
        void Save();  
    }  
}  

My Department class is set up as a Partial Class to a class generated by LINQ TO SQL in my dbml file.

Any help would be very much appreciated.

Thanks -

A: 

I think the exception is pretty clear.

you need to tell Windsor what type you want to provide the implementation for your IDepartmentRepository

Krzysztof Koźmic
I have this in my Web.Config and getting same results: <castle> <components> <component id="DepartmentRepository" service="DataModel.IDepartmentRepository,DataModel" type="DataModel.IDepartmentRepository,DataModel" lifestyle="PerWebRequest"> </component> </components> </castle> I have IDepartmentRepository is in a separate class library from the MVC Project. I have IDepartmentRepository in a class library named DataModel. My MVC project is in a Project name MVC. Does my Web.Config look okay?
obautista
I posed a dumb question, sorry. Just realized in my config that my TYPE was pointing to IDepartmentRepository and not my type: DepartmentRepository.
obautista

related questions