Given this:
var query = context.GetTable<T>();
Where "T" is a generic entity passed into the method,
I'd like to do something like this:
if(typeof(TEntity) is IEntitySoftDeletable)
query = query.Cast<IEntitySoftDeletable>.Where(ent => !ent.IsDeleted);
}
Is this possible?
Currently it's telling me that I can't cast this way.
I realize that I could force parameter "T" to be an IEntitySoftDeletable at the class or method level, but I'm trying to avoid that and provide more flexibility from the same method.