public async Task <IActionResult> Page(string id) { KirjaPage page = null; if (!string.IsNullOrEmpty(id)) { page = await _pageDbAccess.GetPageById(id); } else { GoNorthProject project = await _projectDbAccess.GetDefaultProject(); page = await _pageDbAccess.GetDefaultPageForProject(project.Id); if (page == null) { page = new KirjaPage(); page.IsDefault = true; page.ProjectId = project.Id; page.Name = _localizer["DefaultPageName"]; page.Content = _localizer["DefaultPageContent"]; _pageParserService.ParsePage(page); page = await _pageDbAccess.CreatePage(page); } } return(Ok(page)); }