Merge branch 'feature/start-models' into 'unstable'
Added basic version of models See merge request internship-2025/survey-webapp/surveylib!1
This commit is contained in:
commit
1df30344b5
4 changed files with 34 additions and 5 deletions
|
|
@ -1,5 +0,0 @@
|
||||||
namespace SurveyLib.Core;
|
|
||||||
|
|
||||||
public class Class1
|
|
||||||
{
|
|
||||||
}
|
|
||||||
12
SurveyLib.Core/Models/Answer.cs
Normal file
12
SurveyLib.Core/Models/Answer.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
namespace SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
public class Answer
|
||||||
|
{
|
||||||
|
public int TryId { get; set; }
|
||||||
|
public int SurveyId { get; set; }
|
||||||
|
public int QuestionId { get; set; }
|
||||||
|
public string AnswerText { get; set; }
|
||||||
|
|
||||||
|
public Survey Survey { get; set; }
|
||||||
|
public QuestionBase Question { get; set; }
|
||||||
|
}
|
||||||
11
SurveyLib.Core/Models/QuestionBase.cs
Normal file
11
SurveyLib.Core/Models/QuestionBase.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
public class QuestionBase
|
||||||
|
{
|
||||||
|
public int Id { get; set; } // TODO: А ведь их наверное много будет, вдруг int однажды не хватит...
|
||||||
|
public int SurveyId { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
public Survey Survey { get; set; }
|
||||||
|
public ICollection<Answer> Answers { get; set; }
|
||||||
|
}
|
||||||
11
SurveyLib.Core/Models/Survey.cs
Normal file
11
SurveyLib.Core/Models/Survey.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace SurveyLib.Core.Models;
|
||||||
|
|
||||||
|
public class Survey
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
public ICollection<QuestionBase> Questions { get; set; }
|
||||||
|
public ICollection<Answer> Answers { get; set; }
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue