views:

40

answers:

0

I'm having a very hard time getting this working; not even totally sure that it's possible.

Let's imagine a simple scenario:

class Employee {
   List<ITask> Tasks {get;set;}
}

And say we have two different implementations of tasks.

If I want to save the Employee object in MongoDB as a single document (the right way to do it I think), I'm getting completely stuck on being able to do any useful querying. For instance, if a certain kind of ITask has categories and I want to pull ITasks in category A. Or if a task is referenced in another document and I need to go pull it back. I keep running into "not supported" problems (SelectMany, OfType) and then things go downhill from there.

Anyone have some insight on how to accomplish either of those scenarios?