次の LINQ 式があります。
public IList<Objective> GetObjectives(int examId)
{
var objectives = _objectivesRepository
.GetAll()
.Where(o => o.ExamId == examId || examId == 0)
.Include(o => o.ObjectiveDetails)
.ToList();
return objectives;
}
public partial class Objective
{
public int ObjectiveId { get; set; }
public int ExamId { get; set; }
public int Number { get; set; }
public virtual ICollection<ObjectiveDetail> ObjectiveDetails { get; set; }
}
public partial class ObjectiveDetail
{
public int ObjectiveDetailId { get; set; }
public int ObjectiveId { get; set; }
public int Number { get; set; }
public string Text { get; set; }
}
Number
Objective が の順に返され、ObjectiveDetails が の順に返されるように、この式を変更するにはどうすればよいNumber
ですか?