You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Alexandr Shapkin <le...@gmail.com> on 2019/07/30 10:27:03 UTC

RE: Error compiling query: entire LINQ expression shouldbespecifiedwithin lambda passed to Compile method. Part of the query can'tbeoutsidethe Compile method call.

Hello Siva,

DateTime is a struct and thus should work the expected way.

Please, make sure, that you re-created your cache after some development modifications.

I checked this with the following example from your sources:

public class Employee
    {
        …
        [QuerySqlField]
        public DateTime? DateTime { get; set; }
    }


Func<DateTime, IQueryCursor<ICacheEntry<string, Employee>>> issueqry =
                    CompiledQuery.Compile((DateTime dt) => queryable.Where(emp => emp.Value.DateTime < dt));

   foreach (var entry in issueqry(DateTime.UtcNow))
                    Console.WriteLine(">>>    " + entry.Value.Name);



From: siva
Sent: Tuesday, July 30, 2019 10:43 AM
To: user@ignite.apache.org
Subject: Re: Error compiling query: entire LINQ expression shouldbespecifiedwithin lambda passed to Compile method. Part of the query can'tbeoutsidethe Compile method call.


Hi, 

when i tried with DateTime type using where clause, then also getting the
following 
exception 

*Method not supported: System.DateTime.(Int32 CompareTo(System.DateTime))
*


Please suggest if any other way to query with DateTime type.

Thanks 
siva 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/