https://surveychallenge20190227065421.azurewebsites.net/
code-first migration was used
- Surveys
Method | Route | Description |
---|---|---|
GET | /api/surveys | get list of surveys |
GET | /api/survey/{id} | get survey by {id} |
POST | /api/survey | add new survey |
PUT | /api/survey/{id} | update survey by {id} |
DELETE | /api/survey/{id} | delete survey by {id} |
- Questions
Method | Route | Description |
---|---|---|
GET | /api/questions | get list of questions |
GET | /api/question/{id} | get question by {id} |
POST | /api/question | add new question |
PUT | /api/question/{id} | update question by {id} |
DELETE | /api/question/{id} | delete question by {id} |
- SurveyQuestions (uses SurveyQuestions table in db to work with questions specific survey)
Method | Route | Description |
---|---|---|
POST | /api/survey/{id} | Add new question to survey |
GET | /api/surveyquestions/{surveyId} | Get all questions of survey by {surveyId} |
DELETE | /api/surveyquestions/{surveyId} | Removes all questions from survey by {surveyId} |
- QuestionAnswers (uses QuestionAnswers table in db to work with answers with specific question)
Method | Route | Description |
---|---|---|
POST | /api/question/{id} | Add new answer to a question |
POST | /api/question/multiple/{id} | Add list of answers to a question |
GET | /api/questionanswers/{questionId} | Get all ansers of a question |
Route | Description |
---|---|
/surveys/index | shows list of surveys |
/surveys/detail/{id} | shows detail about survey with id = {id} |
/questions/new/{id} | allows user to create new question for survey with id = {id} |
/surveys/new | allows user to create new survey |
You can see all surveys By clicking 'Create new survey' button you can create new survey If you don't fill data into all fields you won't create a survey (there is validation) After creating a survey you can see it in list of surveys You can check details of the specific survey by choosing it Details of specific survey You can create questions for survey by clicking 'Add new question' button Form for creating new question As well there is validation You have to create at least one answer You can create new answer by entering text into available field and clicking add button After clicking 'Save' button question will be created Some more examples As you can see there is viewCount which looks like an eye. It's value increments each time someone enters survey detail page
xUnit is used to create unit tests for api. There is additional DbContext (called: TestApplicationContext) created for testing. It has the same schema as the main context