Limiting the results of System.Data.Linq.Table <T>
I am trying to inherit from my generated datacontext in LinqToSQL - something like this
public class myContext : dbDataContext {
public System.Data.Linq.Table<User>() Users {
return (from x in base.Users() where x.DeletedOn.HasValue == false select x);
}
}
But my Linq statement returns an IQueryable that cannot be applied to a table. Does anyone know a way to limit the contents of Linq.Table. I try to be sure that in any place where my Users table is available, it does not return those marked as deleted. Perhaps I will do it all wrong - any suggestions will be very grateful.
Hal
+3
8 answers