コード例 #1
0
 partial void OnCategoryChanging(Category value);
コード例 #2
0
        public void CreateCategory()
        {
            Stopwatch watch = Stopwatch.StartNew();

            var category = new Category();
            category.CategoryId = ID;
            category.Name = "";
            category.Descn = "";

            try
            {
                using (var context = new PetShopDataContext())
                {
                    context.Category.InsertOnSubmit(category);
                    context.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }

            Assert.IsTrue(true);

            Console.WriteLine("Time: {0} ms", watch.ElapsedMilliseconds);
        }