editablechildlist

editablechildlist

Old forum URL: forums.lhotka.net/forums/t/1785.aspx


PederSvaleng posted on Friday, November 17, 2006

Have a little problem to create the ProjectResource.cs and ProjectResources.cs object with codesmith and the latest csla templates.

If I have got it right... ProjectResources is a editablechildlist with Project as parent. The output of the generated code is

foreach (ProjectResource child in this)

{

   if(child.IsNew)

child.Insert(cn, parent);

else

child.Update(cn, parent);

}

but this gives med compile error: no overload for method 'insert' takes '2' arguments..

and in the ProjectResource file the code is

internal void Update(SqlConnection cn)

which should have been

internal void Update(Sqlconnection cn, ProjectResource project)

or something like that? Is it me doing something wrong or is the template wrong?

--

Peder

 

 

rasupit replied on Tuesday, November 21, 2006

Peder,
If you search on "editablechildlist" and "parent" you'll find many discussions on this issue.  The short answer is, you need to define parent on ProjectResource

Ricky

Copyright (c) Marimer LLC