コード例 #1
0
        public bool PopulateTagsTable()
        {
            try
            {
                var tags = new List<Tag>();

                var tag = new Tag { Id = 1, Name = "Tag 1", Description = "Description Description Description Description Description" };
                tags.Add(tag);

                tag = new Tag { Id = 2, Name = "Tag 2", Description = "Description Description Description Description Description" };
                tags.Add(tag);

                tag = new Tag { Id = 3, Name = "Tag 3", Description = "Description Description Description Description Description" };
                tags.Add(tag);

                _context.Tags.InsertAllOnSubmit(tags);
                _context.SubmitChanges();

                return true;
            }
            catch (Exception ex)
            {
                if (System.Diagnostics.Debugger.IsAttached)
                {
                    MessageBox.Show(ex.Message);
                }
                return false;
            }
        }
コード例 #2
0
 partial void UpdateTag(Tag instance);
コード例 #3
0
 partial void DeleteTag(Tag instance);
コード例 #4
0
 partial void InsertTag(Tag instance);