using OrderCriterias; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ManagerInterfaces { /// /// All methods to handle chapters /// /!\ all methods returns a task /// /// a DTO, Entity or Model chapter public interface IChapterManager { /// /// get the number of chapters /// /// the number of chapters public int getNbChapters(); /// /// add a chapter /// /// chapter to add /// /// the chapter added or the chapter that correspond /// to it and that is already in the database /// Task addChapter(T chapter); /// /// remove a chapter /// /// the chapter to remove /// /// the chapter removed or null if /// the chapter does not exist /// Task removeChapter(T chapter); /// /// remove a chapter /// /// the identifier of the chapter to remove /// /// the chapter removed or null if /// the chapter does not exist /// Task removeChapter(int id); /// /// get a chapter /// /// the identifier of the chapter /// /// the chapter that correspond /// to the id or null if the /// chapter does not exist /// Task getChapter(int id); /// /// get a chapter /// /// the name of the chapter /// /// the chapter that correspond /// to the name or null if the /// chapter does not exist /// Task getChapter(string name); /// /// get a part of all chapters /// /// the actual page /// number of chapters in a page /// the order criteria /// /// a set of the number of page and /// all chapters in the database for /// the page nb (or null if the page /// does not exist (<=> (nb-1)*count outside /// boundaries (0, getNbElement()-1))) /// Task<(int nbPages, IEnumerable? chapters)> getChapters(int nb, int count, ChapterOrderCriteria orderCriteria = ChapterOrderCriteria.ById); /// /// update a chapter /// /// the id of the chapter to update /// the new name of the chapter /// /// the chapter modified or null if /// the id does not refer a chapter /// Task updateChapter(int id, string newName); } }