There is more than 60,000 records
in the table. I am using Microsoft SQL Server 2016 (RTM-GDR)
.
I have planned to store the data into the DataTable property
and fetch only the top 100
out of the data available in the Datatable property
at a time. And then delete this top 100
records so that processing would be better for each time.
Service Code
public DataTable Records { get; set; }
In Service Method
if(this.Records == null || this.Records.Count() == 0)
{
//For the first time add records to the `Records` data table.
}
else {
//The Records already there.
}
Web API Code
[HttpGet]
public HttpResponseMessage GetReports()
{
var tempReports = this.mService.GetReports();
if (tempReports == null)
{
return ErrorResult(HttpStatusCode.NotFound);
}
return OK(tempReports );
}
Problem
This this.Records.Count() is 0
always whenever I send new request
to fetch the data.
The data is getting successfully
added to the Records
data table but it's not being preserved
.
Is there something I have to do explicitly
from the Web API to preserve
the records for the particular user
?