added some service interfaces
This commit is contained in:
parent
cac3cd5ea4
commit
74b650dd8e
4 changed files with 48 additions and 0 deletions
12
SurveyLib.Core/Services/IAnswerService.cs
Normal file
12
SurveyLib.Core/Services/IAnswerService.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
namespace SurveyLib.Core.Services;
|
||||||
|
|
||||||
|
public interface IAnswerService
|
||||||
|
{
|
||||||
|
Task<bool> AddAnswerAsync(Answer answer);
|
||||||
|
Task<bool> UpdateAnswerAsync(Answer answer);
|
||||||
|
Task<bool> DeleteAnswerAsync(int id);
|
||||||
|
Task<IEnumerable<Answer>> GetAnswersByCompletionIdAsync(int completionId);
|
||||||
|
Task<IEnumerable<Answer>> GetAnswersByQuestionIdAsync(int questionId);
|
||||||
|
}
|
||||||
11
SurveyLib.Core/Services/ICompletionService.cs
Normal file
11
SurveyLib.Core/Services/ICompletionService.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
using SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
namespace SurveyLib.Core.Services;
|
||||||
|
|
||||||
|
public interface ICompletionService
|
||||||
|
{
|
||||||
|
Task<bool> AddCompletionAsync(Completion completion);
|
||||||
|
Task<bool> UpdateCompletionAsync(Completion completion);
|
||||||
|
Task<bool> DeleteCompletionAsync(int id);
|
||||||
|
Task<IEnumerable<Completion>> GetCompletionsBySurveyIdAsync(int surveyId);
|
||||||
|
}
|
||||||
11
SurveyLib.Core/Services/IQuestionService.cs
Normal file
11
SurveyLib.Core/Services/IQuestionService.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
using SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
namespace SurveyLib.Core.Services;
|
||||||
|
|
||||||
|
public interface IQuestionService
|
||||||
|
{
|
||||||
|
Task<bool> AddQuestionAsync(QuestionBase question);
|
||||||
|
Task<bool> UpdateQuestionAsync(QuestionBase question);
|
||||||
|
Task<bool> DeleteQuestionAsync(int id);
|
||||||
|
Task<IEnumerable<QuestionBase>> GetQuestionsBySurveyIdAsync(int surveyId);
|
||||||
|
}
|
||||||
14
SurveyLib.Core/Services/ISurveyService.cs
Normal file
14
SurveyLib.Core/Services/ISurveyService.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
using SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
namespace SurveyLib.Core.Services;
|
||||||
|
|
||||||
|
public interface ISurveyService
|
||||||
|
{
|
||||||
|
Task<bool> AddSurveyAsync(Survey survey);
|
||||||
|
Task<bool> UpdateSurveyAsync(Survey survey);
|
||||||
|
Task<bool> DeleteSurveyAsync(int id);
|
||||||
|
Task<IEnumerable<Survey>> GetSurveysAsync();
|
||||||
|
Task<Survey> GetSurveyByIdAsync(int id);
|
||||||
|
Task<Survey> GetSurveyWithQuestionsByIdAsync(int id);
|
||||||
|
Task<Survey> GetSurveyWithAnswersByIdAsync(int id);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue