Let's start with defining our client-side interfaces to handle questions, answers, and results; from Solution Explorer, right-click on the /ClientApp/app/interfaces/ folder and create the TypeScript files with the appropriate names and contents described here:
- question.ts: Here's the code for the question.ts file:
interface Question {
Id: number;
QuizId: number;
Text: string;
}
- answer.ts: Here's the answer.ts file:
interface Answer {
Id: number;
QuestionId: number;
Text: string;
Value: number;
}
- result.ts: Here's the result.ts file:
interface Result {
Id: number;
QuizId: number;
Text: string;
MinValue?: number;
MaxValue?: number;
}
Note how we also included the foreign-key properties to retrieve the Quiz or Question parent, as we'll use them in our client app soon enough.