If you set the default xmlmediatypeformatter to UseXmlSerializer, calls to CanWriteType with an instance of DataQuery<T> return false. This is usually triggered in a call to CreateResponse which then throws. DataQuery<T> is the concrete type that linq to sql implements IQueryable<T> with.
There's a branch in the implementation that seems to allow IQueryables for the datacontractserializer but only IEnumerables for the xml one.
If you subclass XmlMediaTypeFormatter and (for example) return true from CanWriteType, the underlying XmlSerializer writes the results back just fine.
Action methods that return IQueryable should be supported for both the data contract and xml serializers.
There's a branch in the implementation that seems to allow IQueryables for the datacontractserializer but only IEnumerables for the xml one.
If you subclass XmlMediaTypeFormatter and (for example) return true from CanWriteType, the underlying XmlSerializer writes the results back just fine.
Action methods that return IQueryable should be supported for both the data contract and xml serializers.