Esempio n. 1
0
 /// <summary>
 /// Create a new BlogUserRole object.
 /// </summary>
 /// <param name="blogUserRoleId">Initial value of the BlogUserRoleId property.</param>
 /// <param name="blogUserId">Initial value of the BlogUserId property.</param>
 /// <param name="blogRoleId">Initial value of the BlogRoleId property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 public static BlogUserRole CreateBlogUserRole(global::System.Int32 blogUserRoleId, global::System.Int32 blogUserId, global::System.Int32 blogRoleId, global::System.DateTime createDate)
 {
     BlogUserRole blogUserRole = new BlogUserRole();
     blogUserRole.BlogUserRoleId = blogUserRoleId;
     blogUserRole.BlogUserId = blogUserId;
     blogUserRole.BlogRoleId = blogRoleId;
     blogUserRole.CreateDate = createDate;
     return blogUserRole;
 }
Esempio n. 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the BlogUserRoles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBlogUserRoles(BlogUserRole blogUserRole)
 {
     base.AddObject("BlogUserRoles", blogUserRole);
 }
Esempio n. 3
0
        public void MyTestInitialize()
        {
            HttpContext.Current = new HttpContext(
                new HttpRequest("test.aspx", "http://localhosttest/test.aspx", ""),
                new HttpResponse(new StringWriter())
                );

            repo = VeritasRepository.GetInstance();
            repo.StartTransaction();

            //Insert our fake BlogConfig
            BlogConfig blogConfig = FakeModelCreator.GetFakeBlogConfig();
            repo.Add(blogConfig);
            TestBlogConfig = blogConfig;

            repo.Save();
            TestBlogConfig.LoadConfigFromXml();

            TestBlogUser = FakeModelCreator.GetFakeBlogUser(TestBlogConfig.BlogConfigId);
            repo.Add(TestBlogUser);
            repo.Save();

            TestBlogEntry = FakeModelCreator.GetFakeBlogEntry(TestBlogConfig.BlogConfigId, TestBlogUser.BlogUserId);
            repo.Add(TestBlogEntry);
            TestBlogCategory = FakeModelCreator.GetFakeBlogCategory(TestBlogConfig.BlogConfigId, TestBlogUser.BlogUserId);
            repo.Add(TestBlogCategory);
            TestBlogFeedbackAuthor = FakeModelCreator.GetFakeBlogFeedbackAuthor(TestBlogConfig.BlogConfigId);
            repo.Add(TestBlogFeedbackAuthor);
            TestBlogRole = FakeModelCreator.GetFakeBlogRole(TestBlogConfig.BlogConfigId);
            repo.Add(TestBlogRole);
            TestBlogUserRole = FakeModelCreator.GetFakeBlogUserRole(TestBlogUser.BlogUserId, TestBlogRole.BlogRoleId);
            repo.Add(TestBlogUserRole);
            TestBlogLog = FakeModelCreator.GetFakeBlogLog(TestBlogConfig.BlogConfigId);
            repo.Add(TestBlogLog);
            TestBlogMenuItem = FakeModelCreator.GetFakeBlogMenuItem(TestBlogConfig.BlogConfigId);
            repo.Add(TestBlogMenuItem);
            TestBlogPage = FakeModelCreator.GetFakeBlogPage(TestBlogConfig.BlogConfigId, TestBlogUser.BlogUserId);
            repo.Add(TestBlogPage);
            TestBlogMedia = FakeModelCreator.GetFakeBlogMedia(TestBlogConfig.BlogConfigId, TestBlogUser.BlogUserId);
            repo.Add(TestBlogMedia);
            TestBlogFeedback = FakeModelCreator.GetFakeBlogFeedback(TestBlogConfig.BlogConfigId, TestBlogEntry.BlogEntryId, TestBlogFeedbackAuthor.BlogFeedbackAuthorId);
            repo.Add(TestBlogFeedback);
            TestBlacklist = FakeModelCreator.GetFakeBlacklist(TestBlogConfig.BlogConfigId);
            repo.Add(TestBlacklist);
            TestBlogEntryCategory = FakeModelCreator.GetFakeBlogEntryCategory(TestBlogEntry.BlogEntryId, TestBlogCategory.BlogCategoryId);
            repo.Add(TestBlogEntryCategory);
            TestBlogEntryViewCount = FakeModelCreator.GetFakeBlogEntryViewCount(TestBlogConfig.BlogConfigId, TestBlogEntry.BlogEntryId);
            repo.Add(TestBlogEntryViewCount);

            repo.Save();
            if (!Directory.Exists("C:\\VeritasTestLogs"))
                Directory.CreateDirectory("C:\\VeritasTestLogs");
        }
Esempio n. 4
0
 public static BlogUserRole GetFakeBlogUserRole(int blogUserId, int blogRoleId)
 {
     var blogUserRole = new BlogUserRole()
     {
         BlogRoleId = blogRoleId,
         BlogUserId = blogUserId,
         CreateDate = DateTime.Now
     };
     return blogUserRole;
 }
Esempio n. 5
0
 public void Delete(BlogUserRole blogUserRole)
 {
     db.BlogUserRoles.DeleteObject(blogUserRole);
 }
Esempio n. 6
0
 public void Add(BlogUserRole blogUserRole)
 {
     db.BlogUserRoles.AddObject(blogUserRole);
 }