Hello.
I am attempting to use some functionality from ODataContrib in WCF Data Service for an Entity Framework code-first model built with the DbModelBuilder fluent api. Specifically, I'm using ODataUriParser.ParseFilter and ODataUriParser.ParseOrderBy (I'm attempting to parse request queries using ODataContrib in my OnStartProcessingRequest callback in order to implement some additional multi-tenant field-level security). These methods require IEdmModel and IEdmType instances. Is there a way to convert a DbModel and/or DbCompiledModel generated by a DbModelBuilder (code-first fluent api) into an IEdmModel for use in these methods, or else build one with the pre-configured DbModelBuilder?
I know there is the EdmxReader.TryParse(...) method, which can get an IEdmModel out of an EDMX file, but I couldn't find anything similar for a code-first model. Maybe there's a way to write out an EDMX given a code-first model? Might be slower, but I can cache the result if I need to.