public BlogService(IPostCache cache, IPostStore store, RazorEngine engine, IOptions <SiteSettings> siteSettings) { _cache = cache; _store = store; _engine = engine; _siteSettings = siteSettings.Value; }
public PostsModule(IPostStore postStore) : base("/admin/posts") { // Returns 10 most recent drafts and 10 most recent posts Get["/"] = parameters => { var drafts = new List<PostsIndexViewModel.PostInformation>(); var posts = new List<PostsIndexViewModel.PostInformation>(); for (int i = 1; i < 11; i++) { var draftPost = new PostsIndexViewModel.PostInformation { Date = DateTime.Now.AddDays(0 - i), PostId = i, Title = string.Format("Draft post {0:00}", i) }; var publishedPost = new PostsIndexViewModel.PostInformation { Date = DateTime.Now.AddDays(0 - i), PostId = i, Title = string.Format("Published post {0:00}", i) }; drafts.Add(draftPost); posts.Add(publishedPost); } return View["Index.cshtml", new PostsIndexViewModel { Drafts = drafts, Posts = posts }]; }; Post["/add"] = parameters => { string title = Request.Form.title; var addResult = postStore.AddDraft(title); return Response.AsJson(addResult); }; }
public InitialStateCreator(IPostCache cache, IPostStore store, IMetadataProcessor metadata) { _cache = cache; _store = store; _metadata = metadata; Initialization = InitializeAsync(); }
public SocApp( IPostStore postStore, IFollowStore followStore, IPostFormatter postFormatter) { _postStore = postStore; _followStore = followStore; _postFormatter = postFormatter; }
public GetAllPostsQuery(IdentityUser CurrentUser, UserAccount ExistingAccount, IFriendsListStore _FriendListStore, INotificationBox _NotificationBox, IUserStore _UserStore, IPostStore _PostStore) { this.CurrentUser = CurrentUser; this.ExistingAccount = ExistingAccount; this._FriendListStore = _FriendListStore; this._NotificationBox = _NotificationBox; this._UserStore = _UserStore; this._PostStore = _PostStore; }
public PostsController(UserManager <User> userManager, SignInManager <User> signInManager, ApplicationDbContext _context, IUserStore _userStore, IPostStore _postStore, ICommentStore _commentStore, CurrentPostDTO _currentpost, IFriendsListStore _FriendListStore, INotificationBox _notificationBox, ILogger <PostsController> _logger) { this.userManager = userManager; this.signInManager = signInManager; this._context = _context; this._userStore = _userStore; this._postStore = _postStore; this._commentStore = _commentStore; this._currentpost = _currentpost; this._FriendListStore = _FriendListStore; this._notificationBox = _notificationBox; this._logger = _logger; }
public PostController(IPostStore postStore, IUnitOfWork unitOfWork) { _postStore = postStore; _unitOfWork = unitOfWork; }
public InitialStateCreator(IPostCache cache, IPostStore store, IMetadataProcessor metadata) { _cache = cache; _store = store; _metadata = metadata; }
public MetadataProcessor(IPostStore store) { _store = store; }