为UWP应用程序使用Realm数据库。我们正在从.NETCore 1.4升级到NETCore 2.0,并且Realm String.Contains()函数损坏了。
有问题的查询如下:
var collections = realm.All<Collection>().Where(c =>
c.Title.Contains(query, StringComparison.OrdinalIgnoreCase) ||
c.TextDescription.Contains(query, StringComparison.OrdinalIgnoreCase));
当尝试使用该查询的结果(例如:collections.ToList()
)时,我们收到以下异常:
Exception thrown: 'System.NotSupportedException' in System.Private.CoreLib.dll
An exception of type 'System.NotSupportedException' occurred in
System.Private.CoreLib.dll but was not handled in user code
The method 'Contains' is not supported
Core 2不支持吗?