From ab331a32d9a6e75eadf39010f73f12260488c307 Mon Sep 17 00:00:00 2001 From: shept Date: Sun, 20 Apr 2025 19:30:50 +0500 Subject: [PATCH] maybe model inheritance is friends we made along the way... - moved AnswerVariants to QuestionBase due to strange logic --- SurveyLib.Core/Models/QuestionBase.cs | 2 ++ .../Models/QuestionVariants/MultipleAnswerQuestion.cs | 1 - SurveyLib.Core/Models/QuestionVariants/SingleAnswerQuestion.cs | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SurveyLib.Core/Models/QuestionBase.cs b/SurveyLib.Core/Models/QuestionBase.cs index 2ca4fa0..02c0dc8 100644 --- a/SurveyLib.Core/Models/QuestionBase.cs +++ b/SurveyLib.Core/Models/QuestionBase.cs @@ -8,6 +8,8 @@ public class QuestionBase public string Discriminator { get; set; } + public ICollection? AnswerVariants { get; set; } + public Survey Survey { get; set; } public ICollection Answers { get; set; } } \ No newline at end of file diff --git a/SurveyLib.Core/Models/QuestionVariants/MultipleAnswerQuestion.cs b/SurveyLib.Core/Models/QuestionVariants/MultipleAnswerQuestion.cs index d2eb5b0..7f3848f 100644 --- a/SurveyLib.Core/Models/QuestionVariants/MultipleAnswerQuestion.cs +++ b/SurveyLib.Core/Models/QuestionVariants/MultipleAnswerQuestion.cs @@ -2,5 +2,4 @@ namespace SurveyLib.Core.Models.QuestionVariants; public class MultipleAnswerQuestion : QuestionBase { - public ICollection AnswerVariants { get; set; } } \ No newline at end of file diff --git a/SurveyLib.Core/Models/QuestionVariants/SingleAnswerQuestion.cs b/SurveyLib.Core/Models/QuestionVariants/SingleAnswerQuestion.cs index de1bb01..912d8a6 100644 --- a/SurveyLib.Core/Models/QuestionVariants/SingleAnswerQuestion.cs +++ b/SurveyLib.Core/Models/QuestionVariants/SingleAnswerQuestion.cs @@ -2,5 +2,4 @@ namespace SurveyLib.Core.Models.QuestionVariants; public class SingleAnswerQuestion : QuestionBase { - public ICollection AnswerVariants { get; set; } } \ No newline at end of file