I am building a n-tier app, and used the OpenAccess to generate the classes for my postgresql db. On the client end, I retrieve a list DTO for one of my objects of type project (which is mapped eventually to a projects table). I can retrieve a single project of type ProjectDto or retrieve List<ProjectDto> projects with no problem. I retrieve them through the WCF Plain Web Services. I am having a problem when trying to create a new Project item and persisting it.
I tried the following:
// This is the plain web service
TestAdminServices.AdministrationServiceClient client = new TestAdminServices.AdministrationServiceClient();
List<TestAdminServices.ProjectsDto> projs= client.ReadProjectses(); //return a list of current projects
// Now create a new project
TestAdminServices.ProjectsDto prj = new TestAdminServices.ProjectsDto();
prj.Comments = "First Created by code";
prj.CreationDate = DateTime.Now;
prj.ModificationDate = prj.CreationDate;
prj.DatabaseName = "IBET_Data";
prj.MapName = "Hello Steve";
prj.ProjectName = "IBEt_MAIN";
// now persist it
client.UpdateProjects(prj); // <- THIS GENERATES "An object key cannot be resolved from string"
How can I create a new project object and have it persist back to the database? Any help or suggestions would be appreciated.