public IActionResult GetHomePage() { Blog defaultBlog = PlatformConfigutationService.GetDefaultBlog(); string platformName = PlatformConfigutationService.GetPlaformName(); if (defaultBlog == null) { IEnumerable <Blog> blogList = BlogService.GetAllBlogs(); return(Ok(new HomePageResponse(platformName, blogList))); } else { return(Ok(new HomePageResponse(platformName, defaultBlog))); } }
public IActionResult GetDefaultBlog() { try { Blog defaultBlog = PlatformConfigutationService.GetDefaultBlog(); return(Ok(defaultBlog)); } catch (BlogNotFoundException exception) { return(HandleUnexpectedException(exception, "Inconsistent state: there is a default blog ID set, but the blog could not be found!")); } catch (Exception exception) { return(HandleUnexpectedException(exception)); } }