private void InsertNewData(DatabaseData dd) { Keyword k = new Keyword(); k.Name = dd.KeywordName; Project p = new Project(); p.ProjectName = dd.ProjectName; p.Location = dd.ProjectLocation; XRef r = new XRef(); r.Url = dd.ReferenceUrl; r.Description = dd.ReferenceDescription; Solution s = new Solution(); s.Name = dd.SolutionName; s.Location = dd.SolutionLocation; _ctx.Keywords.Add(k); _ctx.Projects.Add(p); _ctx.XRefs.Add(r); _ctx.Solutions.Add(s); //add instances to navigation propeties k.Projects.Add(p); p.Keywords.Add(k); p.XRefs.Add(r); r.Projects.Add(p); s.Projects.Add(p); _ctx.SaveChanges(); CleanUp(); MessageBox.Show("Test Data inserted"); }
public void CreateXRef(XRef xRef) { _ctx.SaveChanges(); }