public void InsertAssignmentPerStudentPerCourse()
        {
            //Όλα τα assignments. Φυσικά τα θέλω >0 το πλήθος.
            var queryAss = from c in dbContext.Assignments select c;

            if (!dbContext.Assignments.Any())
            {
                Console.WriteLine("No assignments to connect to courses.");
                return;
            }

            //Όλα τα μαθήματα. Φυσικά τα θέλω >0 το πλήθος.
            var queryCr = from c in dbContext.Courses select c;

            if (!dbContext.Courses.Any())
            {
                Console.WriteLine("No courses to assign the trainers to.");
                return;
            }

            //Τυπώνω assignments και μαθήματα για να ξέρει ο χρήστης αυτά που έχει στη διάθεση του.
            Console.WriteLine("The available assignments are the following:");
            foreach (var assInfo in queryAss)
            {
                Console.WriteLine("{0}. Title: {1}.", assInfo.id, assInfo.title);
            }
            Console.WriteLine();

            Console.WriteLine("The available courses are the following:");
            foreach (var crInfo in queryCr)
            {
                Console.WriteLine("{0}: {1}", crInfo.id, crInfo.title);
            }
            Console.WriteLine();

            Console.WriteLine("Type a valid assignment id and a valid course id to assign that assignment to that course. Take note that:\n" +
                              "The two ID ust be given in that order.\n" +
                              "The two ID must be separated by one or more spaces.\n" +
                              "In case the assignment is already given at that course, no changes will occur.");
            string inputa, inputb;

            if (!ConsoleRead.ReadTwoIntegers(out inputa, out inputb))
            {
                Console.WriteLine("Wrong input.");
                return;
            }
            //Η ReadTwoIntegers έχει εξασφαλίσει ότι το Parse πορεί να συμβεί
            int ida = int.Parse(inputa);
            int idb = int.Parse(inputb);

            /*Ορίζω και αρχικοποιώ μια μεταβλητή assignment και μαθήματος. Είμαι σίγουρος ότι κι οι δυο πίνακες έχουν
             * τουλάχιστον ένα στοιχείο οπότε τους αρχικοποιώ με το πρώτο - δεν έχει σημασία, απλά για να μη χτυπάει παρακάτω
             * ο κώδικας - καθώς οι τιμές τους στη πραγματικότητα δίνονται εντός if.*/
            Assignment wAss = queryAss.First();
            Course     wCr  = queryCr.First();
            //Ελέγχει αν το id assignment είναι υπαρκτό
            bool found = false;

            foreach (var assInfo in queryAss)
            {
                if (assInfo.id == ida)
                {
                    found = !found;
                    wAss  = assInfo;
                    break;
                }
            }
            if (!found)
            {
                Console.WriteLine("Given assignment id doesn't exist.");
                return;
            }
            //Ελέγχει αν το id μαθήματος είναι υπαρκτό
            found = false;
            foreach (var crInfo in queryCr)
            {
                if (crInfo.id == idb)
                {
                    found = !found;
                    wCr   = crInfo;
                    break;
                }
            }
            if (!found)
            {
                Console.WriteLine("Given course id doesn't exist.");
                return;
            }

            //Διατρέχω το πίνακα Course_has_Assignment για ήδη υπάρχουσα αντιστοίχηση.
            if (dbContext.Course_has_Assignment.Any(a => a.Assignment_id == ida && a.Course_id == idb))
            {
                Console.WriteLine("Given assignment already belongs to given course.");
                return;
            }

            //Αντιστοιχώ assignment-μάθημα στη περίπτωση που όλα πήγαν καλά.
            Course_has_Assignment cr_assNew = new Course_has_Assignment()
            {
                Assignment_id = ida,
                Course_id     = idb
            };

            dbContext.Course_has_Assignment.Add(cr_assNew);
            cr_assNew.Course     = wCr;
            cr_assNew.Assignment = wAss;

            //Τώρα θα αναθέσω σε όλους τους μαθητές του μαθήματος το assignment αυτό.
            foreach (var std in wCr.Students)
            {
                Student_gets_Assignment i = new Student_gets_Assignment()
                {
                    Student_id    = std.id,
                    Course_id     = cr_assNew.Course_id,
                    Assignment_id = cr_assNew.Assignment_id,
                    //Ο μαθητής δεν έχει ακόμη παραδώσει το assignment για να πάρει βαθμούς
                    totalMark = null,
                    oralMark  = null
                };
                dbContext.Student_gets_Assignment.Add(i);
                i.Student = std;
                i.Course_has_Assignment = cr_assNew;
            }

            dbContext.SaveChanges();
        }
        //__________Inserting Function-members________________________________________________________
        public bool Populate(uint std_no = 100, uint cr_no = 10, uint tr_no = 15, uint ass_no = 15)
        {
            //Επιστρέφει false αν υπήρχαν ήδη εγγραφές
            //if (dbContext.Courses.Any()) return false; TODO uncomment them
            //if (dbContext.Trainers.Any()) return false;
            //if (dbContext.Assignments.Any()) return false;
            //if (dbContext.Students.Any()) return false;

            RandomData rd = new RandomData();

            //Προσθέτει μαθήματα
            for (int i = 0; i < cr_no; i++)
            {
                string _title, _stream, _type;
                rd.RandomCourseData(out _title, out _stream, out _type);
                DateTime start = rd.RandomFutureDate();
                DateTime end   = rd.RandomFutureDate();
                if (end < start)
                {
                    DateTime temp = start;
                    start = end;
                    end   = temp;
                }
                Course cr = new Course()
                {
                    title      = _title,
                    stream     = _stream,
                    type       = _type,
                    start_date = start,
                    end_date   = end
                };
                dbContext.Courses.Add(cr);
            }
            dbContext.SaveChanges();
            var queryCr = from c in dbContext.Courses select c;

            //Προσθέτει μαθητές
            for (int i = 0; i < std_no; i++)
            {
                string fname, sname;
                rd.RandomFullName(out fname, out sname);
                Student std = new Student()
                {
                    firstName   = fname,
                    lastName    = sname,
                    dateOfBirth = rd.RandomPastDate(),
                    tuitionFees = (decimal?)rd.RandomFees()
                };
                dbContext.Students.Add(std);
                foreach (var item in queryCr)
                {
                    if (rd.RandomNumber((int)std_no / (int)cr_no / 2) == 0)
                    {
                        std.Courses.Add(item);
                    }
                }
            }
            //Προσθέτει εκπαιδευτές
            for (int i = 0; i < tr_no; i++)
            {
                string fname, sname, sub;
                rd.RandomFullName(out fname, out sname);
                rd.RandomCourseData(out sub);
                Trainer tr = new Trainer()
                {
                    firstName = fname,
                    lastName  = sname,
                    subject   = sub
                };
                dbContext.Trainers.Add(tr);
                foreach (var item in queryCr)
                {
                    if (rd.RandomNumber((int)cr_no / 2) == 0)
                    {
                        tr.Courses.Add(item);
                    }
                }
            }
            dbContext.SaveChanges();
            //Προσθέτει εργασίες
            for (int i = 0; i < ass_no; i++)
            {
                Assignment ass = new Assignment()
                {
                    title       = "Auto-generated title",
                    description = rd.Gibberish(50),
                    subDateTime = (Date?)rd.RandomFutureDate(),
                    oralMark    = 100,
                    totalMark   = 100
                };
                dbContext.Assignments.Add(ass);
                foreach (var item in queryCr)
                {
                    if (rd.RandomNumber((int)cr_no) == 0)
                    {
                        Course_has_Assignment cr_ass = new Course_has_Assignment()
                        {
                            Assignment_id = ass.id,
                            Course_id     = item.id
                        };
                        dbContext.Course_has_Assignment.Add(cr_ass);
                        cr_ass.Course     = item;
                        cr_ass.Assignment = ass;
                        foreach (var s in item.Students)
                        {
                            Student_gets_Assignment std_ass = new Student_gets_Assignment()
                            {
                                Student_id    = s.id,
                                Course_id     = cr_ass.Course_id,
                                Assignment_id = cr_ass.Assignment_id
                            };
                            dbContext.Student_gets_Assignment.Add(std_ass);
                            std_ass.Student = s;
                            std_ass.Course_has_Assignment = cr_ass;
                        }
                    }
                }
            }
            dbContext.SaveChanges();



            return(true);
        }