Is the BusinessListBase structure specifically Fetch method signature different from 7.0 to 8.0? #3760
-
Hello Im working on creating a BusinessListBase class but for some reason I get errors. Im using CSLA 7.0 but the sample was created using version 8.0 . The error that I get is "TargetParameterCountException" Im using the sample code from the ProjectTracker sample.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
My error Csla.DataPortalException This exception was originally thrown at this call stack: Inner Exception 1: Inner Exception 2: Inner Exception 3: Inner Exception 4: Inner Exception 5: Inner Exception 6: Inner Exception 7: |
Beta Was this translation helpful? Give feedback.
-
So I found what is causing my issue. If I change the attribute for the method from [FetchChild] to [Fetch] it works(its actully hits the method in my businesslistbase class). With the attribute of FetchChild it will not hit the method at all and I get the errors above. This is on the my Business List Base class which has the following: public class ParcelOldEditList : BusinessListBase<ParcelOldEditList, ParcelOldEdit>
{
//along with all other method. Remove Contains Assign
[Fetch]
private void Fetch(string parcelChangeID, [Inject] DataAccess.DTO.IParcelOldDal dal, [Inject] IChildDataPortal<ParcelOldEdit> portal)
{
var data = dal.GetParcelOldListAsync(parcelChangeID);
using (LoadListMode)
{
foreach (var item in data.Result)
Add(portal.FetchChild(item));
}
}
} |
Beta Was this translation helpful? Give feedback.
Is the list a root object? If so, then
Fetch
is the correct attribute.If you intend for the list to be a child object, it should be loaded as part of its parent, and the parent should use an
IChildDataPortal<C>
to fetch the child list.