c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -


I have performed a linq query using Entityframework as below

  GroupMaster getGroup = Null; GetGroup = DataContext.Groups.FirstOrDefault (item = & gt; keyword.IndexOf (item.Keywords, StringComparison.OrdinalIgnoreCase)> = 0 & amp; amp; item.ISNAmd)   

I found an exception like the method when executing it

LINQ units do not recognize the 'Inter 32 index of (system string, system. String compromise)' method, and This method can not be translated to Store expression.

Includes () method is sensitive by default, then I need to convert to minimize. Is there any method in which a string match match is examined and whether there is any method to solve the index question of the method?

You actually have four options

  1. Databases globally Change the colon of it can be done in many ways, a simple Google search should reveal to them.
  2. Change the mix of individual tables or columns.
  3. Use a stored procedure and specify the call statement on your query
  4. Perform a query and return a large set of results, then use the links to filter the memory Please. No. 4 is not a good option unless your result is set too small. # 3 Good if you can not change the database (but you can not use linux with it). ).

    Number 1 and 2 are the options for which you have to make your entire data model, or if you want to do it only on specific areas.

    Changing the Database Coalition:

    Changing the Database Component:

    Changing the column collation:

    Use of the collet statement in a stored proc: < / P>

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -