I am currently returning JSON data like this:
return new JsonResult {
Data = from service in _serviceTable.GetAll(
u => u.PartitionKey == "1Z0-851" &
u.RowKey.CompareTo(lowerBound) >= 0 &
u.RowKey.CompareTo(upperBound) < 0)
select new {
service.PartitionKey,
service.RowKey,
service.TopicDescription,
service.SubTopicDescription,
service.Weight,
service.Format,
service.Style,
service.ShortTitle }
};
This works good but now I would like to return some data to indicate status. I tried adding this as , status in this way:
ShortTitle },
Status = "abc"
};
but I get a syntax error message saying “does not contain a definition for status
Can someone hopefully explain how I could add status and send it back to my web page. Note that there are many rows from the serviceTable but just one status to send back.
Please check the syntax, but you get the idea.
To access the data you’ll have to use something like data.Result and data.Status for the status.