public bool PopulateCategoriesTable() { try { var categories = new List<Category>(); var category = new Category { Id = 1, Name = "Productivity" }; categories.Add(category); category = new Category { Id = 2, Name = "Games" }; categories.Add(category); category = new Category { Id = 3, Name = "Other" }; categories.Add(category); _context.Categories.InsertAllOnSubmit(categories); _context.SubmitChanges(); return true; } catch (Exception ex) { if (System.Diagnostics.Debugger.IsAttached) { MessageBox.Show(ex.Message); } return false; } }
partial void UpdateCategory(Category instance);
partial void DeleteCategory(Category instance);
partial void InsertCategory(Category instance);