private void CreateCategory() { if (NewCatName.Text.Length > 250) { MessageBox.Show("Category name is too long!"); } else if (NewCatName.Text != "") { using (IdeasContext ctx = new IdeasContext(IdeasContext.ConnectionString)) { ctx.CreateIfNotExists(); var category = new Categories() { Name = NewCatName.Text }; ctx.Categories.InsertOnSubmit(category); ctx.SubmitChanges(); NavigationService.GoBack(); } } }
partial void UpdateCategories(Categories instance);
partial void DeleteCategories(Categories instance);
partial void InsertCategories(Categories instance);