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:
Вячеслав 2025-03-12 19:03:01 +00:00
commit 1df30344b5
4 changed files with 34 additions and 5 deletions

View file

@ -1,5 +0,0 @@
namespace SurveyLib.Core;
public class Class1
{
}

View 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; }
}

View 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; }
}

View 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; }
}