RavenDB NotSupportedException

When I run the code

 

I got following exception

RavenDB NotSupportedException

An exception of type ‘System.NotSupportedException’ occurred in Raven.Client.Lightweight.dll but was not handled in user code

Additional information: Could not understand expression: .Where(p => p.ProductSn.Contains(value(YSPOS.MainWindow+<>c__DisplayClass10_0).barCode))

 

It’s because there is no index for ProductSn attribute is created.

 

Solution

To fix this issue, we need create index fo ProductSn attribute.

 

Create a class extending AbstractIndexCreationTask class

 

Then execute this index creation task after DocumentStore initialization.