Provides a Data Object Source for interacting with Subtext Data. One example is a DataObjectProvider, which stores Subtext data in a database (which itself is provided via the DbProvider class).
Inheritance: System.Configuration.Provider.ProviderBase
 public DeletePostCommand(ObjectProvider repository, int postID, ISearchEngineService searchEngineService)
 {
     _targetName = "Post";
     _targetID = postID;
     Repository = repository;
     SearchEngine = searchEngineService;
 }
Example #2
0
 public SubtextContext(Blog blog, RequestContext requestContext, UrlHelper urlHelper, ObjectProvider repository,
     IPrincipal user, ICache cache, IServiceLocator serviceLocator)
 {
     Blog = blog;
     RequestContext = requestContext;
     UrlHelper = urlHelper;
     Repository = repository;
     User = user ?? requestContext.HttpContext.User;
     Cache = cache ?? new SubtextCache(requestContext.HttpContext.Cache);
     ServiceLocator = serviceLocator;
 }
Example #3
0
 public KeywordExpander(ObjectProvider repository)
 {
     _repository = repository;
 }
Example #4
0
 public SlugGenerator(FriendlyUrlSettings slugSettings, ObjectProvider repository)
 {
     SlugSettings = slugSettings ?? DefaultSettings;
     Repository = repository;
 }
 public BlogLookupService(ObjectProvider repository, HostInfo host)
 {
     Repository = repository;
     _host = host;
 }
 private static void CreateWelcomeComment(ObjectProvider repository, AdminUrlHelper adminUrlHelper, Entry entry)
 {
     string commentBody = ScriptHelper.UnpackEmbeddedScriptAsString("WelcomeComment.htm");
     string feedbackUrl = adminUrlHelper.FeedbackList();
     commentBody = string.Format(commentBody, feedbackUrl);
     var comment = new FeedbackItem(FeedbackType.Comment)
     {
         Title = "re: Welcome to Subtext!",
         Entry = entry,
         Author = "Subtext",
         DateCreated = DateTime.Now,
         DateModified = DateTime.Now,
         Approved = true,
         Body = commentBody
     };
     repository.Create(comment);
 }
 private static void CreateWelcomeCategories(ObjectProvider repository, Blog blog)
 {
     repository.CreateLinkCategory(new LinkCategory
     {
         Title = "Programming",
         Description = "Blog posts related to programming",
         BlogId = blog.Id,
         IsActive = true,
         CategoryType = CategoryType.PostCollection,
     });
     repository.CreateLinkCategory(new LinkCategory
     {
         Title = "Personal",
         Description = "Personal musings, random thoughts.",
         BlogId = blog.Id,
         IsActive = true,
         CategoryType = CategoryType.PostCollection
     });
 }
Example #8
0
 public static Mock<ISubtextContext> SetupRepository(this Mock<ISubtextContext> context,
     ObjectProvider repository)
 {
     context.Setup(c => c.Repository).Returns(repository);
     return context;
 }