IEnumerable properties of a search result POCO remain unassigned


Description

Automatic type conversion might not work for the IEnumerable<T> type when mapping index document fields to properties. An example of the affected properties looks like this:

public class MySearchItem
{
    [IndexField("treelist")]
    public IEnumerable<Guid> TreeList { get; set; }
    [IndexField("multilist")]
    public IEnumerable<ID> MultiList{ get; set; }
}

In this case, the TreeList and MultiList properties remain unassigned (null) even if the search result includes a valid value in the "treelist_sm" and "multilist_sm" field.

Solution

To resolve the issue, consider one of the following options: