BaseKanbanModel.cs 914 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Diagnostics.CodeAnalysis;
  3. using System.Linq;
  4. using Comal.Classes;
  5. using InABox.Core;
  6. using InABox.Mobile;
  7. namespace PRS.Mobile
  8. {
  9. public abstract class BaseKanbanModel<TModel,TShell> : CoreRepository<TModel, TShell, Kanban>, IKanbanModel
  10. where TModel : CoreRepository<TModel, TShell, Kanban>
  11. where TShell : Shell<TModel, Kanban>, IKanbanShell, new()
  12. {
  13. protected BaseKanbanModel(IModelHost host, Func<Filter<Kanban>>? filter = null, Func<string>? cachefilename = null) : base(host, filter, cachefilename)
  14. {
  15. }
  16. IKanbanShell[] IKanbanModel.Items => this.Items.OfType<IKanbanShell>().ToArray();
  17. public override TShell CreateItem()
  18. {
  19. var result = base.CreateItem();
  20. result.Status = KanbanStatus.Open;
  21. result.ManagerID = App.Data.Me.ID;
  22. return result;
  23. }
  24. }
  25. }