I haven't quite got my head around interfaces so thought I'd word the question in a way that'd help me better understand it.
I'm following a tutorial which has had me make an IQueryable. Why couldn't I just make a Queryable?
Queryable is just a static class that contains extension methods to the IQueryable<T> interface. You wouldn't use Queryable directly in your code but rather invoke its methods given an IQueryable<T> instance.
Queryable is a static class that provides some convenient and useful methods to anything implementing IQueryable. You can't make it because it's already made. You need to make a new class that actually does what you want it to do, and implement IQueryable so other code written to use IQueryable (including Queryable) knows how to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With