private async void TestInsertProject(object sender, EventArgs e)
        {
            DbContext DbContext = DbContext.GetDbContext;
            SQLiteConnection Db = DbContext.Db;

            System.Diagnostics.Debug.WriteLine("Before insert Project.Count: " +
                                               Db.Query<Project>("Select * from Project").Count());

            ProjectsController jc = new ProjectsController();


            string testUuid = "colemak";
            Project project = new Project()
            {
                uuid = testUuid,
            };

            string companyId = "Ikea";
            Company comp = new Company()
            {
                id = companyId
            };

            string courseId = "sverige";
            Course course = new Course()
            {
                id = courseId
            };

            string sgId = "dykking";
            StudyGroup sg = new StudyGroup()
            {
                id = sgId
            };

            StudyGroupProject sgj = new StudyGroupProject()
            {
                StudyGroupId = sgId,
                ProjectUuid = testUuid
            };

            CourseProject lj = new CourseProject()
            {
                CourseId = courseId,
                ProjectUuid = testUuid
            };

            CompanyProject cp = new CompanyProject()
            {
                CompanyId = companyId,
                ProjectUuid = testUuid
            };

            string jtId = "10aarErfaringEcma6";
            JobType jt = new JobType()
            {
                id = jtId
            };

            JobTypeProject jtp = new JobTypeProject()
            {
                ProjectUuid = testUuid,
                JobTypeId = jtId
            };

            // try catch on tables that will not be affected by a job delete
            try
            {
                Db.Insert(comp);
            }
            catch
            {
            }
            Db.Insert(project);
            try
            {
                Db.Insert(course);
            }
            catch
            {
            }
            try
            {
                Db.Insert(sg);
            }
            catch
            {
            }
            Db.Insert(sgj);
            Db.Insert(lj);
            Db.Insert(cp);
            try
            {
                Db.Insert(jt);
            }
            catch
            {
            }
            Db.Insert(jtp);

            System.Diagnostics.Debug.WriteLine("After insert: Project.Count: " +
                                               Db.Query<Project>("Select * from Project").Count());
        }
        public void InsertStudyGroupProject(string studygroupId, string projectUuid)
        {
            System.Diagnostics.Debug.WriteLine("StudyGroupProject created");
            StudyGroupProject sgp = new StudyGroupProject();
            sgp.StudyGroupId = Hasher.Base64Encode(studygroupId);
            sgp.ProjectUuid = projectUuid;
            System.Diagnostics.Debug.WriteLine("StudyGroupProject before insert");

            lock (DbContext.locker)
            {
                var rowsAffected =
                    Db.Query<StudyGroupProject>(
                        "Select * FROM StudyGroupProject WHERE StudyGroupProject.StudyGroupId = ?" +
                        " AND StudyGroupProject.ProjectUuid = ?", sgp.StudyGroupId, sgp.ProjectUuid).Count;
                System.Diagnostics.Debug.WriteLine("Deserialize: StudyGroupProject rowsAffected: " +
                                                   rowsAffected);
                if (rowsAffected == 0)
                {
                    // The item does not exists in the database so safe to insert
                    Db.Insert(sgp);
                }
            }
            System.Diagnostics.Debug.WriteLine("StudyGroupProject after insert");
        }