public IHttpActionResult GetWebContent(int id)
        {
            WebContentService webContentService = new WebContentService();

            var content = webContentService.GetWebContentById(id, db);

            return(Ok(content));
        }
Beispiel #2
0
        public IHttpActionResult PostWebContent(Models.WebContent webContent)
        {
            WebContentService webContentService = new WebContentService();

            webContentService.UpsertWebContent(webContent, db);

            return(CreatedAtRoute("DefaultApi", new { id = webContent.Id }, webContent));
        }
        public IHttpActionResult PostWebContent(Models.WebContent webContent)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            WebContentService webContentService = new WebContentService();

            webContentService.UpsertWebContent(webContent, db);



            return(CreatedAtRoute("DefaultApi", new { id = webContent.Id }, webContent));
        }
        public static IServiceCollection AddSpeedWagonCms(this IServiceCollection services, string path, string uploadsPath, IFileProvider contentFileProvider, IFileProvider uploadFileProvider)
        {
            IContentService     contentService     = new CacheLessRuntimeContentService(path, null, contentFileProvider);
            IEditorService      editorService      = new EditorService(contentService, SPEEDWAGON_HOST);
            IContentTypeService contentTypeService = new ContentTypeService(contentService, SPEEDWAGON_HOST);
            IWebContentService  webContentService  = new WebContentService(contentService, SPEEDWAGON_HOST);

            IContentService    uploadContentService = new CacheLessRuntimeContentService(uploadsPath, null, uploadFileProvider);
            IFileUploadService fileUploadService    = new FileUploadService(uploadContentService, string.Empty, uploadFileProvider);
            ISearchService     searchService        = new LuceneSearchService(contentService, Path.Combine(path, "search"));

            services.AddSingleton <ISpeedWagonAdminContext>(s =>
                                                            new SpeedWagonAdminContext(
                                                                path,
                                                                contentService,
                                                                contentTypeService,
                                                                editorService,
                                                                webContentService,
                                                                fileUploadService,
                                                                searchService)
                                                            );

            return(services);
        }
Beispiel #5
0
 public HomeController(AccountService accountService, CategoryService categoryService, WebContentService webContentService)
     : base(accountService, categoryService)
 {
     _webContentService = webContentService;
 }
Beispiel #6
0
 public AdminController(AccountService accountService, CategoryService categoryService, LeaderboardService leaderboardService, WebContentService webContentService)
     : base(accountService, categoryService)
 {
     _leaderboardService = leaderboardService;
     _webContentService  = webContentService;
 }