Assume a business entity "Account":
public class Account : BusinessBase<Account> { ... }
Include an "Account" collection:
public class AccountList : BusinessListBase<AccountList, Account>The issue with BusinessListBase DataPortal_Fetch is that it has no access to the DataPortal; only a business entity may invoke the DataPortal.
In the "AccountList" snippet above, the collection creates a new "Account" entity for each provided account ID. Each newly created "Account" entity invokes its internal Fetch method.
This to me is a concern; were 300 account IDs supplied, 300 separate database invocations would occur.
I am familiar with almost every line of CSLA yet I cannot find a batch "Fill" method for a collection in which the DB may return 300 rows and all the "Account" entities created with one DB call.
Has anyone a work around?
Thanks all!
Nick
My mistake; after I read your message, I inspected some of the mods I had created within CSLA and realized that the Command Pattern I implemented in the business entity base was not implemented in the list base as well.
I preferred not to permit the entity access to the DAL and created a command pattern in which Fetch simply called Execute() for each command object provided.
I have extended his FW quite significantly; adding methods such as these to the list base:
Copyright (c) Marimer LLC