having problem in WCSF ApplicationController

Topics: Web Client Software Factory, Project Management Forum, UIP Application Block discussion, User Forum
Apr 7, 2007 at 6:52 AM
Edited Apr 7, 2007 at 6:57 AM
Hi everyone



i am developing a small project using the WCSF (Web Client Software Factory). In this project there are 2 business modules and 1 foundation module. I am facing the problem in the Administrator controller.
i registered the services also in ModuleInitilizer in properway, but the problem is invoking the AdministratorController constructors.

Business Entities:
Profile.cs
Units.cs
Lesson.cs

Presenter code:
i created the ProfilePresenter like this...
ProfilePresenter.cs
public class ProfilesPresenter : Presenter<IProfiles>
{

public AdministratorController _controller;

public ProfilesPresenter(CreateNewAdministratorController controller)
{
_controller = controller;
}
.
.
.


The Application Controller Code is like this
AdministratorController.cs
public class AdministratorController
{
private IUnitsDataAccess _UnitsDataAccess;
private ILessonDataAccess _LessonDataAccess;
private IProfileDataAccess _ProfileDataAccess;

public AdministratorController(ServiceDependencyIUnitsDataAccess unitsdataaccess)
{
_UnitsDataAccess = unitsdataaccess;
}
public AdministratorController(ServiceDependencyILessonDataAccess lessondataaccess)
{
_LessonDataAccess = lessondataaccess;
}
public AdministratorController(ServiceDependencyIProfileDataAccess profiledataaccess)
{
_ProfileDataAccess = profiledataaccess;
}

.
.
.

when i am executing the code, i am getting the problem like this...

Error:
Cannot create an abstract class.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MemberAccessException: Cannot create an abstract class.



Please help me any one.....please
Apr 7, 2007 at 4:20 PM
My guess is that you really don't want 3 constructors, but a single constructor as follows:

public AdministratorController([ServiceDependency]IUnitsDataAccess unitsdataaccess,[ServiceDependency]ILessonDataAccess lessondataaccess,[ServiceDependency]IProfileDataAccess profiledataaccess)
{
	_UnitsDataAccess = unitsdataaccess;
	_LessonDataAccess = lessondataaccess;
	_ProfileDataAccess = profiledataaccess;
}

Regards,

Dave

_______________________

David Hayden
Microsoft MVP C#
Apr 9, 2007 at 11:11 AM

Thank you David





Regards
--------------------------
Srikanth Dasari
Jiva infotech
India