Good day all:
I'm developing a WEB API that returns a paged response to a jQuerydatatable end point. Because the code repeats itself, I encapsulated all the logic in the generic procedure below. The code works perfectly when I pass the class (entity) I want the SQL stored procedure to page. The issue is that I want to access the value of two of the properties return by the IEnumerable <T> namely TotalCount and FilteredCount which are always returned by the stored procedure
public async Task<OutgoingResponseToEndPointDatatable<T>> SendingDataBackToEndPointJqueryDatatable(OncomingEndPointDatatableRequest request, string NameOfStoredProcedure)
{
var parameters = new StoredProcedureParameters()
{
PageNo = Convert.ToInt32(request.start / request.length),
PageSize = request.length,
SortColumn = request.Order[0].Column,
SortDirection = request.Order[0].Dir,
SearchValue = request.Search != null ? request.Search.Value.Trim() : ""
};
IEnumerable<T> outcome= await _db.LoadPaginationSearchAndSortingStoredProcedure<T, dynamic>(storedProcedure: NameOfStoredProcedure, parameters: parameters);
How I can refer to the int values of the TotalCount and FitredCount properties return by the procedure above? I tried using var properies=trypeof(T). GetProperties but an object is return and I want to access to the int values not the object.