Example #1
0
 public PostsController(IPostsService postsService, IForumsService forumsService, UserManager <ApplicationUser> userManager)
 {
     this.postsService  = postsService;
     this.forumsService = forumsService;
     this.userManager   = userManager;
     //this.userService = userService;
 }
 public ManageCategoriesController(IPostsService posts, IAnswersService answers, ICommentsService comments, ICategoriesService categories)
 {
     this.posts = posts;
     this.answers = answers;
     this.comments = comments;
     this.categories = categories;
 }
Example #3
0
 public PostRepliesController(IForumsService forumsService, IPostsService postsService, IApplicationUsersService usersService, UserManager <ApplicationUser> usersManager)
 {
     this.forumsService = forumsService;
     this.postsService  = postsService;
     this.usersService  = usersService;
     this.usersManager  = usersManager;
 }
Example #4
0
 public AddPostViewModel(IPostsService postsService, IPickPhotoService pickPhotoService)
 {
     InitOfferTypes();
     _postsService     = postsService;
     _pickPhotoService = pickPhotoService;
     PostOwnerId       = DataContainer.GetUserId();
 }
Example #5
0
 public HomeController(IUsersService usersService, IPostsService postsService, IVotesService votesService, IVotesForCommentsService votesForCommentsService)
 {
     this.usersService            = usersService;
     this.postsService            = postsService;
     this.votesService            = votesService;
     this.votesForCommentsService = votesForCommentsService;
 }
 public UsersService(IMessagingService messagingService, ICryptographyService cryptographyService, IConfigurationService configurationService, IPostsService postsService)
 {
     _messagingService     = messagingService;
     _cryptographyService  = cryptographyService;
     _configurationService = configurationService;
     _postsService         = postsService;
 }
        public InsanelySimpleBlogPostController(
            IPostsService postsService)
        {
            Condition.Requires(postsService, "postsService").IsNotNull();

            _postsService = postsService;
        }
Example #8
0
 public PostsController(QuoteBookDbContext context, UserManager <User> userManager, ICategoryService categoryService, IPostsService postsService)
 {
     this.context         = context;
     this.userManager     = userManager;
     this.categoryservice = categoryService;
     this.postsService    = postsService;
 }
Example #9
0
 public HomeController(
     IPostsService posts,
     ICategoriesService postCategories)
 {
     this.posts = posts;
     this.postCategories = postCategories;
 }
Example #10
0
 public ForumThreadsService(IUnitOfWork unitOfWork, IUserService userService, IPostsService postsService, ILogger logger)
 {
     _unitOfWork   = unitOfWork;
     _userService  = userService;
     _postsService = postsService;
     _logger       = logger;
 }
Example #11
0
 public PostsController(
     IPostsService postsService,
     IPhotoService photoService)
 {
     _postsService = postsService;
     _photoService = photoService;
 }
Example #12
0
 public HomeController(
     UserManager <ApplicationUser> userManager,
     IPostsService postsService)
 {
     this.userManager  = userManager;
     this.postsService = postsService;
 }
Example #13
0
 public PostsController(IPostsService posts, ICategoriesService postCategory, ICommentsService postComments, IPointsService postPoints)
 {
     this.posts = posts;
     this.postCategory = postCategory;
     this.postComments = postComments;
     this.postPoints = postPoints;
 }
Example #14
0
 public PostReactionsController(
     IPostsService postsService,
     IPostReactionsService postReactionsService)
 {
     this.postsService         = postsService;
     this.postReactionsService = postReactionsService;
 }
Example #15
0
 public CommentsController(IPostsService postsService, UserManager <ApplicationUser> userManager,
                           ICommentsService commentsService)
 {
     this.postsService    = postsService;
     this.userManager     = userManager;
     this.commentsService = commentsService;
 }
Example #16
0
 public PostsController(UserManager <ApplicationUser> userManager, IPostsService postsService, ICategoriesService categoriesService, IDeletableEntityRepository <Post> postsRepository)
 {
     this.userManager       = userManager;
     this.postService       = postsService;
     this.categoriesService = categoriesService;
     this.postsRepository   = postsRepository;
 }
Example #17
0
 public CategoriesController(ICategoriesService categoriesService, IPostsService postsService, ILogger <CategoriesController> logger, IHttpContextAccessor http)
 {
     this.categoriesService = categoriesService;
     this.postsService      = postsService;
     this.logger            = logger;
     this.http = http;
 }
Example #18
0
 public PostsController(
     IPostsService postsService,
     UserManager <ApplicationUser> userManager)
 {
     this.postsService = postsService;
     this.userManager  = userManager;
 }
Example #19
0
 public TagsController(
     ITagsService tagsService,
     IPostsService postsService)
 {
     this.tagsService  = tagsService;
     this.postsService = postsService;
 }
        public PostsApprovalFlowServiceTest()
        {
            var services = new ServiceCollection();

            //Register entity framework context for app
            services.AddDbContext <EngineContext>(options =>
            {
                options.UseSqlServer("Server=DESARROLLO7;Database=BlogEngineApp;User Id=BlogEngineUsr;Password=@!P@ssword;",
                                     sqlServerOptionsAction: sqlOptions =>
                {
                    //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
                    sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
                });
            });

            #region [Dependency Injection]
            services.AddTransient <IPostsRepository, SQLPostsRepository>();
            services.AddTransient <IPostsService, PostsService>();
            services.AddTransient <IPostsApprovalFlowService, PostsApprovalFlowService>();
            #endregion

            var serviceProvider = services.BuildServiceProvider();
            _postsApprovalFlowService = serviceProvider.GetRequiredService <IPostsApprovalFlowService>();
            _postsService             = serviceProvider.GetRequiredService <IPostsService>();
        }
 public CategoriesController(
     ICategoriesService categoriesService,
     IPostsService postsService)
 {
     this.categoriesService = categoriesService;
     this.postsService      = postsService;
 }
Example #22
0
 public ProfilesController(IProfilesService profilesService, UserManager <ApplicationUser> userManager, IPostsService postsService, IWebHostEnvironment webHostEnvironment)
 {
     this.profilesService    = profilesService;
     this.userManager        = userManager;
     this.postsService       = postsService;
     this.webHostEnvironment = webHostEnvironment;
 }
 public PostReportsController(
     IPostsService postsService,
     IPostReportsService postReportsService)
 {
     this.postsService       = postsService;
     this.postReportsService = postReportsService;
 }
Example #24
0
 public RepliesController(
     IPostsService postsService,
     IRepliesService repliesService)
 {
     this.postsService   = postsService;
     this.repliesService = repliesService;
 }
 public ManageCategoriesController(IPostsService posts, IAnswersService answers, ICommentsService comments, ICategoriesService categories)
 {
     m_Posts      = posts;
     m_Answers    = answers;
     m_Comments   = comments;
     m_Categories = categories;
 }
 public ManagePostsController(
     IManagePostsService managePostsService,
     IPostsService postsService)
 {
     this.managePostsService = managePostsService;
     this.postsService       = postsService;
 }
        public HttpResponseMessage DeletePost(string blogId, string id, HttpRequestMessage request)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent);

            try
            {
                IPostsService postsService = ObjectFactory.GetInstance <IPostsService>();
                var           post         = postsService.Get(String.Format("posts/{0}", id));

                if (post != null)
                {
                    postsService.Delete(String.Format("posts/{0}", id));
                }
                else
                {
                    response.StatusCode = HttpStatusCode.NotFound;
                }
            }
            catch (Exception)
            {
                response.StatusCode = HttpStatusCode.InternalServerError;
            }

            return(response);
        }
Example #28
0
 public UsersService(PaintStoreContext ctx, IPostsService postsService, IFollowersService followersService, ISignInService signInService)
 {
     _paintStoreContext = ctx;
     _postsService      = postsService;
     _followersService  = followersService;
     _signInService     = signInService;
 }
Example #29
0
 public HomeController(
     IPostsService postsService,
     ITagsService tagsService)
 {
     _postsService = postsService;
     _tagsService  = tagsService;
 }
        public HttpResponseMessage UpdatePost(string blogId, string id, HttpRequestMessage request)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent);

            try
            {
                IPostsService postsService = ObjectFactory.GetInstance <IPostsService>();
                var           post         = postsService.Get(String.Format("posts/{0}", id));

                if (post != null)
                {
                    XmlReader       reader = XmlReader.Create(request.Content.ReadAsStreamAsync().Result);
                    SyndicationFeed feed   = SyndicationFeed.Load(reader);

                    if (feed != null)
                    {
                        SyndicationItem item = feed.Items.FirstOrDefault();

                        if (item != null)
                        {
                            post.title     = item.Title.Text;
                            post.updated   = item.LastUpdatedTime;
                            post.published = item.PublishDate;
                            post.content   = ((TextSyndicationContent)item.Content).Text;

                            var author = item.Authors.FirstOrDefault();

                            if (author != null)
                            {
                                post.author = author.Name;
                                postsService.Update(post);
                            }
                            else
                            {
                                response.StatusCode = HttpStatusCode.BadRequest;
                            }
                        }
                        else
                        {
                            response.StatusCode = HttpStatusCode.BadRequest;
                        }
                    }
                    else
                    {
                        response.StatusCode = HttpStatusCode.BadRequest;
                    }
                }
                else
                {
                    response.StatusCode = HttpStatusCode.NotFound;
                }
            }
            catch (Exception)
            {
                response.StatusCode = HttpStatusCode.InternalServerError;
            }

            return(response);
        }
Example #31
0
 public PostsController(IPostsService posts, IAnswersService answers, ICategoriesService categories, ITagsService tags, ICommentsService comments)
 {
     m_Posts      = posts;
     m_Answers    = answers;
     m_Categories = categories;
     m_Tags       = tags;
     m_Comments   = comments;
 }
Example #32
0
        public SettingsViewModel(IPickPhotoService pickPhotoService, IUserService userService, IPostsService postsService)
        {
            _pickPhotoService = pickPhotoService;
            _userService      = userService;
            _postsService     = postsService;

            BindModel();
        }
Example #33
0
 public FeedController(UserManager <AppUser> userManager, IToastNotification toastNotification, IPostsService postsService, IVendorService vendorService, IStringLocalizer <FeedController> localizer)
 {
     _userManager       = userManager;
     _toastNotification = toastNotification;
     _postsService      = postsService;
     _vendorService     = vendorService;
     _localizer         = localizer;
 }
 public PostsController(IPostsService posts, IAnswersService answers, ICategoriesService categories, ITagsService tags, ICommentsService comments)
 {
     this.posts = posts;
     this.answers = answers;
     this.categories = categories;
     this.tags = tags;
     this.comments = comments;
 }
Example #35
0
 public UsersController(IUsersService usersService, IPostsService postsService, IVotesService votesService, IVotesForCommentsService votesForCommentsService, UserManager <ApplicationUser> userManager)
 {
     this.usersService            = usersService;
     this.postsService            = postsService;
     this.votesService            = votesService;
     this.votesForCommentsService = votesForCommentsService;
     this.userManager             = userManager;
 }
Example #36
0
 public PostsController(
     IPostsService postsService, 
     ICommentsService commentsService, 
     IRegionsService regionsService, 
     IPostCategoriesService postCategoriesService, 
     IPetsService petsService)
     : base()
 {
     this.postsService = postsService;
     this.commentsService = commentsService;
     this.regionsService = regionsService;
     this.postCategoriesService = postCategoriesService;
     this.petsService = petsService;
 }
Example #37
0
 public StatisticsController(IPostsService postsService)
 {
     this.postsService = postsService;
 }
 public void Init()
 {
     this.postsService = TestObjectsFactory.GetPostsService();
 }
Example #39
0
 public ImagesController(IPostsService postsService)
 {
     this.postsService = postsService;
 }
 public PostsController(IPostsService service)
 {
     this.postsService = service;
 }
 public void Setup()
 {
     _service = MockRepository.GenerateStub<IPostsService>();
 }
 public AdminPostsController(IPostsService posts)
 {
     this.posts = posts;
 }
Example #43
0
 public void Init()
 {
     this.postsService = TestObjectFactory.GetPostsService();
     AutoMapperConfig.RegisterMappings(Assembly.Load(Assemblies.WebApi));
 }
Example #44
0
 public PostsController(IPostsService posts, ILikesService likes, UserManager<User> userManager)
 {
     this.posts = posts;
     this.likes = likes;
     this.userManager = userManager;
 }
Example #45
0
 public HomeController(IPostsService postsService)
 {
     this.postsService = postsService;
 }
 public HomeController(IPostsService posts)
 {
     this.postsData = posts;
 }