This is my linq query but here I am not getting null. In the result set in jquery code I am getting null
var Data = await (from Names in apiDbContext.name.AsNoTracking()
.Where(a => a.IsActive == true) orderby NamesList.Name select NamesList)
.ToListAsync();
Below is my screen shot where i am getting null in the data because of this null i am getting error
Uncaught TypeError: Cannot read property 'username' of null.
$.ajax({
type: "GET",
url: remote_url,
async: false,
success: function(data) {
/* Near this data i am getting last record as null because of this
I am getting error as Cannot read property 'username' of null */
$.each(data, function(key, val) {
var title = val[Text];
})
})