can anyone pls share object initializer syntax for sort requests instead of lambdas?
i tried couple of things but they are not working
Code:
Dim req = New SearchRequest(Of testIndex)(txtIndex2.Text.Trim) With {
.Query = New TermQuery("user") With {.Value = txtUserName.Text.Trim},
.Sort = New List(Of ISort) From {
New FieldSort With {
.Field = "startedOn",
.Order = SortOrder.Ascending
}
}
Error:
Severity | Code | Description | Project | File | Line | Suppression State |
---|---|---|---|---|---|---|
Error (active) | BC30002 | Type 'ISort' is not defined. | ES.aspx.vb | 41 |
Severity | Code | Description | Project | File | Line | Suppression State |
---|---|---|---|---|---|---|
Error (active) | BC30456 | 'Field' is not a member of 'FieldSort'. | ES.aspx.vb | 43 |
Severity | Code | Description | Project | File | Line | Suppression State |
---|---|---|---|---|---|---|
Error (active) | BC30456 | 'Ascending' is not a member of 'SortOrder'. | ES.aspx.vb | 44 |