public bool AddBlogArticleCategoryMap(BlogArticleCategoryMap map)
 {
     try
     {
         this._context.blogArticleCategoryMaps.Add(map);
         this._context.SaveChanges();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
 public BlogArticleCategoryMapTests()
 {
     this._bacm = new BlogArticleCategoryMap();
 }
        public void EnsureSeedData()
        {
            if (!this._context.blogArticleCategories.Any())
            {
                BlogArticleCategory category1 = new BlogArticleCategory()
                {
                    shortDescription = "Not Classified",
                    createDateTime = DateTime.Parse("2016-03-19 01:24:43.4104774"),
                    isPrivate = false,
                    name = "Not Classified"
                };
                BlogArticleCategory category2 = new BlogArticleCategory()
                {
                    shortDescription = "This category includes Asp.Net related articles",
                    createDateTime = DateTime.Parse("2016-03-19 01:24:43.4104774"),
                    isPrivate = false,
                    name = "Asp.Net"
                };
                BlogArticleCategory category3 = new BlogArticleCategory()
                {
                    shortDescription = "This category includes Asp.Net related articles",
                    createDateTime = DateTime.Parse("2016-03-19 01:24:43.4104774"),
                    isPrivate = false,
                    name = "WPF"
                };
                this._context.blogArticleCategories.Add(category1);
                this._context.blogArticleCategories.Add(category2);
                this._context.blogArticleCategories.Add(category3);
                this._context.SaveChanges();
            }

            if (!this._context.blogArticles.Any())
            {
                BlogArticle article1 = new BlogArticle()
                {
                    content = "Article 1",
                    isPublished = true,
                    shortDescription = "Article 1",
                    publishDateTime = DateTime.Parse("2016-03-19 01:24:43.4104774"),
                    title = "Article 1",
                    fileList = "abc"
                };

                BlogArticle article2 = new BlogArticle()
                {
                    content = "Article 2",
                    isPublished = true,
                    shortDescription = "Article 2",
                    publishDateTime = DateTime.Parse("2016-03-19 01:24:43.4104774"),
                    title = "Article 2",
                    fileList = "abc"
                };

                BlogArticle article3 = new BlogArticle()
                {
                    content = "Article 3",
                    isPublished = true,
                    shortDescription = "Article 3",
                    publishDateTime = DateTime.Parse("2016-03-19 01:24:43.4104774"),
                    title = "Article 3",
                    fileList = "abc"
                };

                this._context.blogArticles.Add(article1);
                this._context.blogArticles.Add(article2);
                this._context.blogArticles.Add(article3);
                this._context.SaveChanges();
            }

            if (!this._context.blogArticleCategoryMaps.Any())
            {
                BlogArticleCategoryMap bacp1 = new BlogArticleCategoryMap()
                {
                    articleId = 1,
                    categoryId = 1
                };
                BlogArticleCategoryMap bacp2 = new BlogArticleCategoryMap()
                {
                    articleId = 2,
                    categoryId = 1
                };
                BlogArticleCategoryMap bacp3 = new BlogArticleCategoryMap()
                {
                    articleId = 3,
                    categoryId = 2
                };
                this._context.blogArticleCategoryMaps.Add(bacp1);
                this._context.blogArticleCategoryMaps.Add(bacp2);
                this._context.blogArticleCategoryMaps.Add(bacp3);
                this._context.SaveChanges();
            }
        }