This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
System.NotSupportedException: The method 'Format' is not supported.
- Bug after instaling dailybuild 30-01-2010 (it was working on dailybuild from 15-01-2010)
|
|
|
This is a result of moving projections to the server, i.e. SELECTing only the columns/expressions we need rather than loading the full entity and running the projection as client-side .NET code. This means queries involving projections run much more efficiently because they don't have to download the entire row and materialise it as an entity, but it also means that we can no longer handle projections that can't be translated into SQL -- i.e. projections that include methods or properties with no translation -- which includes String.Format. To fix this, insert an AsEnumerable call before performing the projection. This forces LINQ to download the entire data set and perform the projection client-side, just as LightSpeed was doing before. (from c in ... We apologise for making this change in a nightly build -- we try to avoid making breaking changes in nightly builds but we are having to balance that with our customers' requests to move projections to the server where they belong. We'll take another look at how we handle these kinds of changes. |
|
|
Actually this type of query should never be projected to the server since we have no native projection possible for String.Format, but Ivan is correct in indicating that is the likely source of the error. I have tried to run a couple of repro scenarios here based on the code screenshot you provided but each of our queries using String.Format continues to project client side so we are not seeing any exception thrown so it appears this may be a bit of an edge case. Are you able to put togethor a small repro of this behavior and we can have a look at getting this fixed.
Jeremy |
|