|
|
@ -5,15 +5,16 @@ namespace ManagerInterfaces
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// All methods to handle answers
|
|
|
|
/// All methods to handle answers
|
|
|
|
|
|
|
|
/// /!\ all methods returns a task
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="T">a DTO or Entity type answer</typeparam>
|
|
|
|
/// <typeparam name="T">a DTO, Entity or Model answer</typeparam>
|
|
|
|
public interface IAnswerManager<T>
|
|
|
|
public interface IAnswerManager<T>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// get the number of T element
|
|
|
|
/// get the number of T element
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>the number of T element</returns>
|
|
|
|
/// <returns>the number of T element</returns>
|
|
|
|
abstract int getNbElement();
|
|
|
|
public int getNbElements();
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// get a part of all answers
|
|
|
|
/// get a part of all answers
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -21,19 +22,21 @@ namespace ManagerInterfaces
|
|
|
|
/// <param name="count">number of T element in a page</param>
|
|
|
|
/// <param name="count">number of T element in a page</param>
|
|
|
|
/// <param name="orderCriteria">the order criteria</param>
|
|
|
|
/// <param name="orderCriteria">the order criteria</param>
|
|
|
|
/// <returns>
|
|
|
|
/// <returns>
|
|
|
|
/// all T element of the database for
|
|
|
|
/// a set of the number of page and
|
|
|
|
/// this page (or null if (nb-1)*count
|
|
|
|
/// all T element in the database for
|
|
|
|
/// is outside boundaries (0, getNbElement()-1)
|
|
|
|
/// the page nb (or null if the page
|
|
|
|
|
|
|
|
/// does not exist (<=> (nb-1)*count outside
|
|
|
|
|
|
|
|
/// boundaries (0, getNbElement()-1)))
|
|
|
|
/// </returns>
|
|
|
|
/// </returns>
|
|
|
|
public Task<(int nbAnswers, ReadOnlyCollection<T>? answers)> getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById);
|
|
|
|
public Task<(int nbPages, ReadOnlyCollection<T>? answers)> getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById);
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// get a T element with an id
|
|
|
|
/// get some answers that answer to a question
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">the id of the T element question</param>
|
|
|
|
/// <param name="id">the id of the question</param>
|
|
|
|
/// <returns>
|
|
|
|
/// <returns>
|
|
|
|
/// a set of all T element that correspond to this question
|
|
|
|
/// a set of all T answers that answer to this question
|
|
|
|
/// </returns>
|
|
|
|
/// </returns>
|
|
|
|
public Task<ReadOnlyCollection<T>?> getAnswersByIdQuestion(long id);
|
|
|
|
public Task<ReadOnlyCollection<T>?> getAnswersByIdQuestion(uint id);
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// modified a T element with an id
|
|
|
|
/// modified a T element with an id
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -43,7 +46,7 @@ namespace ManagerInterfaces
|
|
|
|
/// the T element (modified) that corresponde
|
|
|
|
/// the T element (modified) that corresponde
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// </returns>
|
|
|
|
/// </returns>
|
|
|
|
public Task<T?> modifierAnswer(long id, T answer);
|
|
|
|
public Task<T?> updateAnswer(uint id, T answer);
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// delete a T element with an id
|
|
|
|
/// delete a T element with an id
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -52,21 +55,23 @@ namespace ManagerInterfaces
|
|
|
|
/// the T element deleted that corresponde
|
|
|
|
/// the T element deleted that corresponde
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// </returns>
|
|
|
|
/// </returns>
|
|
|
|
public Task<T?> supprimerAnswer(long id);
|
|
|
|
public Task<T?> removeAnswer(uint id);
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// delete a T element
|
|
|
|
/// delete a T element
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="answer">the T element to delete</param>
|
|
|
|
/// <param name="answer">the T element to delete</param>
|
|
|
|
public Task supprimerAnswer(T answer);
|
|
|
|
/// <returns>the answer removed or null if there wasn't any</returns>
|
|
|
|
|
|
|
|
public Task<T?> removeAnswer(T answer);
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// add a T element
|
|
|
|
/// add a T element
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="answer">the answer to add</param>
|
|
|
|
/// <param name="answer">the answer to add</param>
|
|
|
|
/// <returns>
|
|
|
|
/// <returns>
|
|
|
|
/// the T element (modified) that corresponde
|
|
|
|
/// the T element that corresponde to
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// the answer added or the answer equal to this
|
|
|
|
|
|
|
|
/// answer if this answer was already added
|
|
|
|
/// </returns>
|
|
|
|
/// </returns>
|
|
|
|
public Task<T> ajouterAnswer(T answer);
|
|
|
|
public Task<T> addAnswer(T answer);
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// get a T element with an id
|
|
|
|
/// get a T element with an id
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -75,6 +80,6 @@ namespace ManagerInterfaces
|
|
|
|
/// the T element that corresponde
|
|
|
|
/// the T element that corresponde
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// to the id or null if there isn't any
|
|
|
|
/// </returns>
|
|
|
|
/// </returns>
|
|
|
|
public Task<T?> getAnswer(long id);
|
|
|
|
public Task<T?> getAnswer(uint id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|