public FileData Create(FileDataView fileData, int problemId = 0, int exerciseId = 0, int quizTestId = 0,
                               int quizQuestionId = 0, int quizAnswerId = 0, int problemAnswerId            = 0)
        {
            var path = CreateFile(fileData.FileBytes);

            var element = new FileData
            {
                OriginalFileName = fileData.FileName,
                FileName         = Path.GetFileName(path),
                FileDir          = Path.GetDirectoryName(path),
                ProblemId        = problemId,
                ExerciseId       = exerciseId,
                QuizTestId       = quizTestId,
                QuizQuestionId   = quizQuestionId,
                QuizAnswerId     = quizAnswerId,
                ProblemAnswerId  = problemAnswerId
            };

            _context.FileData.Add(element);
            _context.SaveChanges();

            return(element);
        }
 public FileData CreateFile(FileDataView element)
 {
     return(Create(element));
 }
 public FileData CreateForQuizAnswer(FileDataView fileData, int quizAnswerId)
 {
     return(Create(fileData, quizAnswerId: quizAnswerId));
 }
 public FileData CreateForQuizQuestion(FileDataView fileData, int quizQuestionId)
 {
     return(Create(fileData, quizQuestionId: quizQuestionId));
 }
 public FileData CreateForQuizTest(FileDataView fileData, int quizTestId)
 {
     return(Create(fileData, quizTestId: quizTestId));
 }
 public FileData CreateForExercise(FileDataView fileData, int exerciseId)
 {
     return(Create(fileData, exerciseId: exerciseId));
 }
 public FileData CreateForProblem(FileDataView fileData, int problemId)
 {
     return(Create(fileData, problemId));
 }
 public FileData CreateForProblemAnswer(int answerId, FileDataView file)
 {
     return(Create(file, problemAnswerId: answerId));
 }