0

I'm implementing jQuery bootgrid with my ASP.Net MVC application. I'm just having an issue with the following code:

var tResult = BootgridResponseData<List<Contact>>()
    {
        current = model.current,
        rowCount = model.rowCount,
        rows = contacts,
        total = contacts.Count
    };

This gives me the following error:

Non-invocable member 'BootgridResponseData' cannot be used like a method.

My BootgridResponseData class is defined as follows:

public class BootgridResponseData<T> where T : class
{
    public int current { get; set; } //? current page
    public int rowCount { get; set; } //? rows per page
    public IEnumerable<T> rows { get; set; } //? items
    public int total { get; set; } //? total rows for whole query
}

What might be wrong here? I'm not 100% sure what I'm doing right here because I've been guided into doing it this way so far.

halfer
  • 19,824
  • 17
  • 99
  • 186
Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
  • 1
    you have missed initialisation, var tResult = new BootgridResponseData>() – Hemant D Mar 30 '17 at 10:11
  • 1
    I don't know if it's in your actual code or if it's just in this question, but, are you missing the "new" keyword in the first line? As in: var tResult = new BootgridResponseData>() { current = model.current, rowCount = model.rowCount, rows = contacts, total = contacts.Count }; – Antonio Garcia Mar 30 '17 at 10:11
  • Yes, that was it... – Barry Michael Doyle Mar 30 '17 at 10:19

0 Answers0