If I want to create an OData service that represents my filesystem, how would I go about that ?
The easy way would be to take a copy of the filesystem and save in a database, and then create the odata service on top of that. But it would be much slicker if there was a way of creating a context based on the actual filesystem.
Huh ?
You can implement a custom provider which can then do whatever you need in regard of getting the data from somewhere. Take a look at this series of how to implement a custom provider: http://blogs.msdn.com/b/alexj/archive/2010/01/07/data-service-providers-getting-started.aspx
There are also samples available at http://www.odata.org/developers/odata-sdk (OData Provider Toolkit).
The tricky part of exposing file system is to define the data model. For example, what would be your primary key for a file (note that it has to be unique for the entire service). It is definitely doable though.