You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sorting by Title or summary or Ev01Value it works fine, but when i try to sort on any of the EVLabels that the value comes from a function i get the 500 error. If we sort by another column, it will get the values from the function and display them without any issue. It only happens when we try to sort on a column whose value comes from a function.
There's nothing in Saule that should care about where the data came from. Perhaps these methods are doing some kind of lazy evaluation that breaks with the queries Saule is generating? Saule does the equivalent of the following:
result= result.OrderBy(idea => idea.Ev01Label);
Perhaps you can try run that and see if that also fails?
As a second idea, is there any reason you cannot return the generic version IQueryable<T>? If it's possible please try that as well, because it could be the case that Saule breaks on regular IQueryable.
When sorting by Title or summary or Ev01Value it works fine, but when i try to sort on any of the EVLabels that the value comes from a function i get the 500 error. If we sort by another column, it will get the values from the function and display them without any issue. It only happens when we try to sort on a column whose value comes from a function.
[Paginated]
[AllowsQuery]
[ReturnsResource(typeof(IdeaResource))]
[HttpGet]
[SecureAccess("idealist-view")]
public IQueryable Get(string query = "", string type = "")
{
var resault = ideaQuery.Select(idea =>
new IdeaModel
{
SubmitterId = idea.SubmitterID,
Summary = idea.Summary,
Title = idea.Title,
Ev01Label = this.getPointer(evaluationFieldOptionsJson, 1, idea.Ev01Label, idea.ID),
Ev02Label = this.getPointer(evaluationFieldOptionsJson, 2, idea.Ev02Label, idea.ID),
Ev03Label = this.getPointer(evaluationFieldOptionsJson, 3, idea.Ev03Label, idea.ID),
Ev04Label = this.getPointer(evaluationFieldOptionsJson, 4, idea.Ev04Label, idea.ID),
Ev05Label = this.getPointer(evaluationFieldOptionsJson, 5, idea.Ev05Label, idea.ID),
Ev06Label = this.getPointer(evaluationFieldOptionsJson, 6, idea.Ev06Label, idea.ID),
Ev07Label = this.getPointer(evaluationFieldOptionsJson, 7, idea.Ev07Label, idea.ID),
Ev08Label = this.getPointer(evaluationFieldOptionsJson, 8, idea.Ev08Label, idea.ID),
Ev09Label = this.getPointer(evaluationFieldOptionsJson, 9, idea.Ev09Label, idea.ID),
Ev010Label = this.getPointer(evaluationFieldOptionsJson, 10, idea.Ev010Label, idea.ID),
Ev01Value = idea.Ev01Value,
Ev02Value = idea.Ev02Value,
Ev03Value = idea.Ev03Value,
Ev04Value = idea.Ev04Value,
Ev05Value = idea.Ev05Value,
Ev06Value = idea.Ev06Value,
Ev07Value = idea.Ev07Value,
Ev08Value = idea.Ev08Value,
Ev09Value = idea.Ev09Value,
Ev010Value = idea.Ev010Value
});
return resault;
}
private string getPointer(string options, int index, string EvLabel, int ideaId)
{
var optionList = JsonConvert.DeserializeObject<List>(options, JsonHelper.GetDefaultSettings());
var option = optionList.FirstOrDefault(p => p.Index == index);
if (option != null)
{
using (IRepositoryUnitOfWorkRead work = this.Tenant.Repository.GetUnitOfWorkRead())
{
return EvaluationDatabaseHelper.GetEvaluationFieldResponse(index, ideaId, work);
}
}
else
return EvLabel;
}
The text was updated successfully, but these errors were encountered: