string Contains method in Linq throws error
Posted: Wed 16 Dec 2015 07:54
I need to run SQLquery into our database usign DBSet function System.Data.Entity.SqlQuery because lack of jsonb query support in Linq.
After that I add Linq expressions on the result using query = query.Where(x => !string.IsNullOrEmpty(x.FieldName))
All this works perfect and no exceptions is thrown, but when i extended that where part to with
query = query.Where(x => x.FieldName.Contains("partOfTextINeedToFind")) i get into problems:
query.ToList() -->
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
Isn't string.contains method supported in devart linqconnect with postgresql?
After that I add Linq expressions on the result using query = query.Where(x => !string.IsNullOrEmpty(x.FieldName))
All this works perfect and no exceptions is thrown, but when i extended that where part to with
query = query.Where(x => x.FieldName.Contains("partOfTextINeedToFind")) i get into problems:
query.ToList() -->
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
Isn't string.contains method supported in devart linqconnect with postgresql?