I have three classes
RequestList : ReadOnlyListBase<RequestList, RequestTaskList>
RequestTaskList : BusinessListBase<RequestTaskList, RequestTask>
RequestTask : BusinessBase<RequestTask>
I first load my RequestTaskLists through the RequestList by setting IsReadOnly temoprarily = false.
Later on though, I want to take a specific RequestTaskList and clear it out to refresh it's contents with the new db values. I'm doing this for a workflow, so that I can keep up to date information. I have the following code in a refresh method in RequestTaskList
using (SmartSafeDataReader dr = new SmartSafeDataReader(cm.ExecuteReader()))
{
this.ClearItems();
while (dr.Read())
this.Add(new RequestTask(dr)); // Refresh List
}
Unfortunetly, my code is breaking down at the the "this.ClearItems()" line and giving me the "Invalid for root objects - use Delete instead." Note that if I comment out the ClearItems() line my code is still able to add new RequestTasks to the RequestTaskList object.
Can anyone offer me some assistance in understanding why I'm unable to use the ClearItems() call here?
Thank you. That solved my problem.
Copyright (c) Marimer LLC