using OrderCriterias; using System.Collections.ObjectModel; namespace ManagerInterfaces { /// /// All methods to handle answers /// /!\ all methods returns a task /// /// a DTO, Entity or Model answer public interface IAnswerManager { /// /// get the number of T element /// /// the number of T element public int getNbElements(); /// /// get a part of all answers /// /// the actual page /// number of T element in a page /// the order criteria /// /// a set of the number of page and /// all T element in the database for /// the page nb (or null if the page /// does not exist (<=> (nb-1)*count outside /// boundaries (0, getNbElement()-1))) /// public Task<(int nbPages, ReadOnlyCollection? answers)> getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById); /// /// get some answers that answer to a question /// /// the id of the question /// /// a set of all T answers that answer to this question /// public Task?> getAnswersByIdQuestion(uint id); /// /// modified a T element with an id /// /// the id of the T element /// an answer that contains all modified properties /// /// the T element (modified) that corresponde /// to the id or null if there isn't any /// public Task updateAnswer(uint id, T answer); /// /// delete a T element with an id /// /// the id of the T element /// /// the T element deleted that corresponde /// to the id or null if there isn't any /// public Task removeAnswer(uint id); /// /// delete a T element /// /// the T element to delete /// the answer removed or null if there wasn't any public Task removeAnswer(T answer); /// /// add a T element /// /// the answer to add /// /// the T element that corresponde to /// the answer added or the answer equal to this /// answer if this answer was already added /// public Task addAnswer(T answer); /// /// get a T element with an id /// /// the id of the T element /// /// the T element that corresponde /// to the id or null if there isn't any /// public Task getAnswer(uint id); } }