예제 #1
0
        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;
            }
        }
예제 #2
0
 partial void UpdateCategory(Category instance);
예제 #3
0
 partial void DeleteCategory(Category instance);
예제 #4
0
 partial void InsertCategory(Category instance);