QAQuestionLookups.cs 837 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace InABox.Core
  4. {
  5. public class QAQuestionLookups : EntityLookup<QAQuestion>
  6. {
  7. public override Columns<QAQuestion> DefineColumns()
  8. {
  9. return base.DefineColumns()
  10. .Add(x => x.Question)
  11. .Add(x => x.Answer);
  12. }
  13. public override string FormatLookup(Dictionary<string, object?> values, IEnumerable<string> exclude)
  14. {
  15. return LookupFactory.DefaultFormatLookup(values, exclude.Concat(new[] { "ID", "Answer" }));
  16. }
  17. public override Filter<QAQuestion> DefineFilter()
  18. {
  19. return null;
  20. }
  21. public override SortOrder<QAQuestion> DefineSortOrder()
  22. {
  23. return new SortOrder<QAQuestion>(x => x.Sequence);
  24. }
  25. }
  26. }