public void InsertJobTypeProject(string jobTypeId, string projectUuid)
        {
            JobTypeProject jtp = new JobTypeProject();
            jtp.JobTypeId = Hasher.Base64Encode(jobTypeId);
            jtp.ProjectUuid = projectUuid;

            lock (DbContext.locker)
            {
                var rowsAffected = Db.Query<JobTypeProject>("Select * FROM JobTypeProject WHERE JobTypeProject.JobTypeId = ?" +
                                             " AND JobTypeProject.ProjectUuid = ?", jtp.JobTypeId, jtp.ProjectUuid).Count;
                System.Diagnostics.Debug.WriteLine("DeserializeOneProjects: JobTypeProject rowsAffected: " +
                                                   rowsAffected);
                if (rowsAffected == 0)
                {
                    // The item does not exists in the database so safe to insert
                    Db.Insert(jtp);
                }
            }
        }
        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());
        }