Group by issue in responses
This commit is contained in:
parent
e82bae41c7
commit
6e305d0db3
@ -67,7 +67,7 @@ namespace DamageAssesment.Api.Responses.Providers
|
|||||||
}
|
}
|
||||||
listSurveyResponse = listSurveyResponse
|
listSurveyResponse = listSurveyResponse
|
||||||
.OrderByDescending(obj => obj.Id)
|
.OrderByDescending(obj => obj.Id)
|
||||||
.GroupBy(obj => new { obj.SurveyId, obj.EmployeeId, obj.LocationId })
|
.GroupBy(obj => new { obj.SurveyId, obj.LocationId })//obj.EmployeeId,
|
||||||
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
||||||
.ToList();
|
.ToList();
|
||||||
if (listSurveyResponse.Any())
|
if (listSurveyResponse.Any())
|
||||||
@ -570,7 +570,7 @@ namespace DamageAssesment.Api.Responses.Providers
|
|||||||
}
|
}
|
||||||
surveyResonses = surveyResonses
|
surveyResonses = surveyResonses
|
||||||
.OrderByDescending(obj => obj.Id)
|
.OrderByDescending(obj => obj.Id)
|
||||||
.GroupBy(obj => new { obj.SurveyId, obj.EmployeeId, obj.LocationId })
|
.GroupBy(obj => new { obj.SurveyId, obj.LocationId })//obj.EmployeeId,
|
||||||
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
||||||
.ToList();
|
.ToList();
|
||||||
var answers = await answerServiceProvider.getAnswersAsync();
|
var answers = await answerServiceProvider.getAnswersAsync();
|
||||||
@ -954,7 +954,7 @@ namespace DamageAssesment.Api.Responses.Providers
|
|||||||
}
|
}
|
||||||
surveyResonses = surveyResonses
|
surveyResonses = surveyResonses
|
||||||
.OrderByDescending(obj => obj.Id)
|
.OrderByDescending(obj => obj.Id)
|
||||||
.GroupBy(obj => new { obj.SurveyId, obj.EmployeeId, obj.LocationId })
|
.GroupBy(obj => new { obj.SurveyId, obj.LocationId }) //obj.EmployeeId,
|
||||||
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
||||||
.ToList();
|
.ToList();
|
||||||
var answers = await answerServiceProvider.getAnswersAsync();
|
var answers = await answerServiceProvider.getAnswersAsync();
|
||||||
@ -1029,7 +1029,7 @@ namespace DamageAssesment.Api.Responses.Providers
|
|||||||
}
|
}
|
||||||
surveyResponses = surveyResponses
|
surveyResponses = surveyResponses
|
||||||
.OrderByDescending(obj => obj.Id)
|
.OrderByDescending(obj => obj.Id)
|
||||||
.GroupBy(obj => new { obj.SurveyId, obj.EmployeeId, obj.LocationId })
|
.GroupBy(obj => new { obj.SurveyId, obj.LocationId })//, obj.EmployeeId
|
||||||
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
.Select(group => group.FirstOrDefault()) // or .FirstOrDefault() if you want to handle empty groups
|
||||||
.ToList();
|
.ToList();
|
||||||
//var surveyResponses = await surveyResponseDbContext.Responses.Where(x => x.SurveyId == survey.Id).ToListAsync();
|
//var surveyResponses = await surveyResponseDbContext.Responses.Where(x => x.SurveyId == survey.Id).ToListAsync();
|
||||||
|
Loading…
Reference in New Issue
Block a user