I am using Serene framework from Serenity.is
I am trying to add "DISTINCT" flag into the one column of the query that fetch the data for the grid I went to the List function of my Endpoint of the table and added the column name "URN" as a distinct field but that didn't have the expected result:
public ListResponse<MyRow> List(IDbConnection connection, ListRequest request,
[FromServices] IClinicalNotesListHandler handler)
{
request.DistinctFields = new SortBy[] { new SortBy("URN")} ;
return handler.List(connection, request);
}
Current result:
SELECT DISTINCT TOP 100
T0.[URN] AS [Urn]
FROM [Clinical_Notes] T0
ORDER BY T0.[URN]
Expected result:
SELECT TOP 100
DISTINCT T0.[URN] AS [Urn]
,T0.[NoteType] As [Note Type] // and other fields in the table
.....
FROM [Clinical_Notes] T0
ORDER BY T0.[URN]
Could someone please help me with this?