/// <summary> /// This method will first fetch an employee and a manager and add them to the company. /// Then finally insert the new company into the SQLITE db. /// </summary> /// <param name="dbContext"></param> private static void CreateNewCompany(TestDatabaseContext dbContext) { Company company = new Company(); var matchedEmployee = (from a in dbContext.GetTable <Employee>() where a.EmployeeID == 4 select a).SingleOrDefault(); var matchedManager = (from a in dbContext.GetTable <Manager>() where a.ManagerRank == "Big Boss" select a).SingleOrDefault(); company.EmployeeID = matchedEmployee.EmployeeID; company.ManagerID = matchedManager.ManagerID; dbContext.Company.InsertOnSubmit(company); dbContext.SubmitChanges(); }