DataPortal.Create<T> failing #3285
-
I'm upgrading from v3.8 to v5.5.3 and for some reason my DataPortal.Create is failing. Exception
The NewSheetCriteria class is defined as:
with public properties and a public constructor that takes the parameters specified in DataPortal.Create. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I am not sure, but I would suggest putting the parameters into a class and then passing the class as the parameter using the "criteria" class type. |
Beta Was this translation helpful? Give feedback.
-
There are possibly two different issues to be addressed:
Here is an example of a working business object with a criteria class for a modern version of CSLA. In this case it's CSLA 6, but 5.5.3 is going to be largely the same, but for the nested factory class in place of static factory methods. |
Beta Was this translation helpful? Give feedback.
Hmm, you might be right. It might be 6.0 where the old behaviour is no longer present. Certainly the methods were dropped from the base class in 6.0, so you can no longer override them - there is nothing to override. The attributes are the way ahead though; other methods of identification are deprecated.
The TargetParameterCount exception is a similar problem to the one you had on the root object, but on a child class. It can't find an Insert method with the correct signature; the number of parameters you are passing from the parent doesn't match with any discovered insert method in the child. Adding an attribute might help with discovery, or it might be a genuine mismatch between what yo…