You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WF-PmAPI/WF_EF_Api/Shared/IQuestionService.cs

60 lines
2.5 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shared
{
public interface IQuestionService<TQuestion>
{
// Retrieves all questions, with pagination support.
// This returns a list of all questions in the system.
Task<PaginationResult<TQuestion>> GetAllQuestion();
// Retrieves a subset of questions based on the provided index and page size.
// 'index' is the starting point for pagination (page number).
// 'pageSize' is the number of questions per page.
Task<PaginationResult<TQuestion>> GetSomeQuestion(int index, int pageSize);
// Retrieves questions that are marked as invalid, with pagination support.
// 'index' is the starting page (page number)
// 'pageSize' is the number of questions per page.
Task<PaginationResult<TQuestion>> GetInvalidQuestion(int index, int pageSize);
// Retrieves a specific question by its unique identifier (id).
// 'id' is the unique identifier of the question.
Task<TQuestion> GetQuestionById(int id);
// Retrieves a random question from the system.
Task<TQuestion> GetRandomQuestion();
// Adds a new question to the system.
// 'question' is the question object that will be added.
Task AddQuestion(TQuestion question);
// Updates an existing question identified by 'id'.
// 'id' is the unique identifier of the question
// 'question' contains the new question data.
Task UpdateQuestion(int id, TQuestion question);
// Removes a question from the system based on its unique identifier ('id').
// 'id' is the unique identifier of the question to be removed.
Task RemoveQuestion(int id);
// Retrieves the total count of questions in the system.
Task<int> CountQuestions();
// Validates or invalidates a question based on its unique identifier ('id').
// 'id' is the unique identifier of the question
// 'isvalid' is a boolean indicating whether the question is valid.
Task ValidateQuestion(int id, bool isvalid);
// Retrieves a random question from a quote to a character.
Task<TQuestion> GetRandomQuestionQuoteToCharacter();
// Retrieves a random question from a quote to a source.
Task<TQuestion> GetRandomQuestionQuoteToSource();
}
}