I have base repository that does most entity work on Silverlight client.
Consider this:
public void DeleteEntityFromManager(T entity)
{
entity.EntityAspect.Delete();
if (this.EntitiesToDeleteWhenDeleting != null && this.EntitiesToDeleteWhenDeleting.Any())
{
foreach (var entitiesToEnclude in this.EntitiesToIncludeWhenLoading)
query = query.Include(entitiesToEnclude);
}
}
"If" statement inside function doesn't work right now, I just copied it from my generic "Query". When I do generic query - I append includes like this:
var query = EntityQuery.Create(typeof(T), this.EntityManager).OrderBySelector(sortSelector);
if (this.EntitiesToIncludeWhenLoading != null && this.EntitiesToIncludeWhenLoading.Any())
{
foreach (var entitiesToEnclude in this.EntitiesToIncludeWhenLoading) query = query.Include(entitiesToEnclude);
}
So, going back to my example on top - I'd like to somehow delete child entities according to EntitiesToDeleteWhenDeleting content which is just IEnumerable<string> and it can be something like "Users".
Edited by katit - 11-Apr-2012 at 12:00pm