I solved my problem, and I think the solution (and the issueI was trying to solve) might be of issue to at least a few.
First: the issue. I wanted a generic way to tap into any EntityDataSource and trap Inserted, Updated, AfterInserted, and AfterUpdated events. I was interested in trapping these events so that I could retrieve any BrokenRulesLists that were generated by EntityNotValidExceptions and display messages on a page, as well as handle the corresponding exception. Further, I'm using the ServiceLayer and processors to maintain control over the business rules and workflow.
The problem I encountered was accessing all of the necessary events from one method parameter. As the origianl poster described, it doesn't seem possible to pass a BaseDataSource<Entity, EntityKey> as a method parameter. I managed a solution by using typed parameters and constraints, like so:
public void RegisterDataSource<D, P>(D ds, P provider)
where D : SBRILD.Web.Data.IDataSourceEvents, SBRILD.Web.Data.ILinkedDataSource
where P : SBRILD.Services.IComponentService
{...}
This ensures that the first parameter (my EntityDataSource) inherits from the interfaces that provide the events (I'm using the second typed parameter to ensure that the corresponding EDS provider is an IComponentService). I'm a former Java programmer, but this type of stuff is making me love C# (.Net 2.0, at least).
The end result of all of this will be a nice way to trap BrokenRulesList messages, as well as other custom messages generated in a processor, and display them in a consolidated area on a page. Hope this might help someone!
Cheers,
Evan