[ https://issues.apache.org/jira/browse/IGNITE-13336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232687#comment-17232687 ]
Ignite TC Bot commented on IGNITE-13336: ---------------------------------------- {panel:title=Branch: [pull/8459/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel} {panel:title=Branch: [pull/8459/head] Base: [master] : New Tests (6)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1} {color:#00008b}Platform .NET (Core Linux){color} [[tests 3|https://ci.ignite.apache.org/viewLog.html?buildId=5733197]] * {color:#013220}dll: CacheLinqTest.TestInvokeThrowsNotSupportedException - PASSED{color} * {color:#013220}dll: CacheLinqTestSqlEscapeAll.TestInvokeThrowsNotSupportedException - PASSED{color} * {color:#013220}dll: CacheLinqTestSimpleName.TestInvokeThrowsNotSupportedException - PASSED{color} {color:#00008b}Platform .NET{color} [[tests 3|https://ci.ignite.apache.org/viewLog.html?buildId=5733195]] * {color:#013220}exe: CacheLinqTest.TestInvokeThrowsNotSupportedException - PASSED{color} * {color:#013220}exe: CacheLinqTest.TestInvokeThrowsNotSupportedException - PASSED{color} * {color:#013220}exe: CacheLinqTest.TestInvokeThrowsNotSupportedException - PASSED{color} {panel} [TeamCity *-> Run :: .NET* Results|https://ci.ignite.apache.org/viewLog.html?buildId=5733200&buildTypeId=IgniteTests24Java8_RunAllNet] > .NET: Misleading LINQ exception when expression can't be translated > ------------------------------------------------------------------- > > Key: IGNITE-13336 > URL: https://issues.apache.org/jira/browse/IGNITE-13336 > Project: Ignite > Issue Type: Bug > Components: platforms > Affects Versions: 2.8.1 > Reporter: Pavel Tupitsyn > Assignee: Sergey Stronchinskiy > Priority: Minor > Labels: .NET > Fix For: 2.10 > > Time Spent: 10m > Remaining Estimate: 0h > > The following program results in a cryptic exception, when the problem is > simply lack of Expression<> wrapper around the query filter: > {code} > class Program > { > private static readonly IIgnite Ignite = Ignition.Start(); > static void Main(string[] args) > { > var cache = GetCache<Foo>(); > cache["1"] = new Foo(); > var res = Where2<Foo>(e => e.Value.X == 0); > Console.WriteLine(res); > } > public static ICache<string, T> GetCache<T>() > { > var cacheName = typeof(T).Name; > var cfg = new CacheConfiguration(cacheName, new > QueryEntity(typeof(T))); > return Ignite.GetOrCreateCache<string, T>(cfg); > } > public static List<T> Where2<T>(Func<ICacheEntry<string, T>, bool> > query) > { > var queryResult = GetCache<T>().AsCacheQueryable().Where(x => > query(x)); > return queryResult.Select(x => x.Value).ToList(); > } > } > public class Foo > { > [QuerySqlField] public int X { get; set; } > } > {code} > We should throw a better exception that says "LINQ expression can't be > translated to SQL because of ..." -- This message was sent by Atlassian Jira (v8.3.4#803005)