Is calling AsQueryable<T> on a DbSet<T> "safe"?
.net, c#, entity-framework-6
Solution
It is not only safe, it is legal and fully standard. This is what OO is all about. You just downcast. A `DbSet` HAS to be a `IQUeryable`, per the contract defined by the designers.
Problem
Say I want to unit test Entity Framework's query logic, one way would be to convert the `DbSet<T>` to `IQueryable<T>` before building the expression trees for easy mocking. Is this "safe" and is there anything to be aware about?