Class QuestionManager
Namespace: Volo.Forms.Questions
Assembly: Volo.Forms.Domain.dll
Syntax
public class QuestionManager : DomainService
Constructors
QuestionManager(IQuestionRepository, IFormRepository)
Declaration
public QuestionManager(IQuestionRepository questionRepository, IFormRepository formRepository)
Parameters
| Type | Name | Description |
|---|---|---|
| IQuestionRepository | questionRepository | |
| IFormRepository | formRepository |
Properties
FormRepository
Declaration
protected IFormRepository FormRepository { get; }
Property Value
| Type | Description |
|---|---|
| IFormRepository |
QuestionRepository
Declaration
protected IQuestionRepository QuestionRepository { get; }
Property Value
| Type | Description |
|---|---|
| IQuestionRepository |
Methods
ClearItemChoicesAsync(QuestionBase)
Declaration
public virtual Task ClearItemChoicesAsync(QuestionBase question)
Parameters
| Type | Name | Description |
|---|---|---|
| QuestionBase | question |
Returns
| Type | Description |
|---|---|
| Task |
CreateItemBasedOnType(QuestionTypes, Guid?)
Declaration
protected virtual QuestionBase CreateItemBasedOnType(QuestionTypes questionType, Guid? id)
Parameters
| Type | Name | Description |
|---|---|---|
| QuestionTypes | questionType | |
| Guid? | id |
Returns
| Type | Description |
|---|---|
| QuestionBase |
CreateQuestionAsync(Form, QuestionTypes, int, bool, string, string, bool, List<(string value, bool isCorrect)>)
Declaration
public virtual Task<QuestionBase> CreateQuestionAsync(Form form, QuestionTypes questionType, int index, bool isRequired, string title, string description, bool hasOtherOption, List<(string value, bool isCorrect)> choices)
Parameters
| Type | Name | Description |
|---|---|---|
| Form | form | |
| QuestionTypes | questionType | |
| int | index | |
| bool | isRequired | |
| string | title | |
| string | description | |
| bool | hasOtherOption | |
| List<(string value, bool isCorrect)> | choices |
Returns
| Type | Description |
|---|---|
| Task<QuestionBase> |
DeleteAsync(QuestionBase)
Declaration
public virtual Task DeleteAsync(QuestionBase question)
Parameters
| Type | Name | Description |
|---|---|---|
| QuestionBase | question |
Returns
| Type | Description |
|---|---|
| Task |
InsertAsync(Guid, QuestionTypes, int, bool, string, string, bool, List<(string value, bool isCorrect)>, Guid?)
Declaration
protected virtual Task<QuestionBase> InsertAsync(Guid formId, QuestionTypes questionType, int index, bool isRequired, string title, string description, bool hasOtherOption, List<(string value, bool isCorrect)> choices, Guid? id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | formId | |
| QuestionTypes | questionType | |
| int | index | |
| bool | isRequired | |
| string | title | |
| string | description | |
| bool | hasOtherOption | |
| List<(string value, bool isCorrect)> | choices | |
| Guid? | id |
Returns
| Type | Description |
|---|---|
| Task<QuestionBase> |
UpdateAsync(Guid, string, int, bool, string, QuestionTypes, bool, List<(Guid Id, string value, bool isCorrect)>)
Declaration
public virtual Task<QuestionBase> UpdateAsync(Guid id, string title, int index, bool isRequired, string description, QuestionTypes questionType, bool hasOtherOption, List<(Guid Id, string value, bool isCorrect)> choiceList)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | |
| string | title | |
| int | index | |
| bool | isRequired | |
| string | description | |
| QuestionTypes | questionType | |
| bool | hasOtherOption | |
| List<(Guid Id, string value, bool isCorrect)> | choiceList |
Returns
| Type | Description |
|---|---|
| Task<QuestionBase> |
UpdateFormLastModificationDateAsync(Guid)
Declaration
protected virtual Task UpdateFormLastModificationDateAsync(Guid createdQuestionFormId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | createdQuestionFormId |
Returns
| Type | Description |
|---|---|
| Task |
UpdateIndexesOfChoiceList(List<(Guid Id, string value, bool isCorrect)>)
Declaration
protected virtual void UpdateIndexesOfChoiceList(List<(Guid Id, string value, bool isCorrect)> choiceList)
Parameters
| Type | Name | Description |
|---|---|---|
| List<(Guid Id, string value, bool isCorrect)> | choiceList |