Skip to content

Commit 091ddce

Browse files
Added Basic Page without backend
1 parent 95af97c commit 091ddce

File tree

85 files changed

+74831
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+74831
-34
lines changed

Blog.Tests/PostsManagerTest.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,6 @@ public void removePostTest()
6464
Assert.IsFalse(postsManager.isPostExists(postName));
6565
}
6666

67-
[Test]
68-
public void searchForUserPostsTest()
69-
{
70-
createManager();
71-
72-
User user = new User(username, password);
73-
74-
Posts posts = new Posts(postName, postData);
75-
76-
postsManager.addPost(user, postName, postData);
77-
78-
Assert.AreEqual(postsManager.searchForUserPosts(username).Length,1);
79-
}
80-
8167
[Test]
8268
public void searchForSpecifiedPostsTest()
8369
{

Blog/Blog.csproj

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
@@ -7,15 +7,20 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Dapper" Version="2.1.35" />
11-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
12-
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.7" />
13-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
14-
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
10+
<Compile Remove="Contracts\Responses\GetAllUsersResponse.cs" />
11+
<Compile Remove="Contracts\Responses\UserResponse.cs" />
12+
<Compile Remove="Database\DatabaseInitializer.cs" />
13+
<Compile Remove="Database\DbConnectionFactory.cs" />
14+
<Compile Remove="Repositories\IUserRepository.cs" />
15+
<Compile Remove="Repositories\PostRepository.cs" />
16+
<Compile Remove="Repositories\UserRepository.cs" />
17+
<Compile Remove="Services\IUserService.cs" />
18+
<Compile Remove="Services\PostService.cs" />
19+
<Compile Remove="Services\UserService.cs" />
1520
</ItemGroup>
1621

1722
<ItemGroup>
18-
<Folder Include="Validation\" />
23+
<Folder Include="Database\" />
1924
</ItemGroup>
2025

2126
</Project>

Blog/Blog.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.10.34928.147
4+
VisualStudioVersion = 17.10.35027.167
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blog", "Blog.csproj", "{FFC565F2-5DFF-45DD-B01E-3CABE9E59364}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blog", "Blog.csproj", "{0CF2BA45-325A-48D3-9048-80D5FA652CB8}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{FFC565F2-5DFF-45DD-B01E-3CABE9E59364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{FFC565F2-5DFF-45DD-B01E-3CABE9E59364}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{FFC565F2-5DFF-45DD-B01E-3CABE9E59364}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{FFC565F2-5DFF-45DD-B01E-3CABE9E59364}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{0CF2BA45-325A-48D3-9048-80D5FA652CB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{0CF2BA45-325A-48D3-9048-80D5FA652CB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{0CF2BA45-325A-48D3-9048-80D5FA652CB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{0CF2BA45-325A-48D3-9048-80D5FA652CB8}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {CDF2A8F4-F13E-4F42-8E8F-07494F83A2BB}
23+
SolutionGuid = {71B26142-FE02-4968-A198-14807066EB19}
2424
EndGlobalSection
2525
EndGlobal

Blog/Pages/Error.cshtml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>

Blog/Pages/Error.cshtml.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
using System.Diagnostics;
4+
5+
namespace Blog.Pages
6+
{
7+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8+
[IgnoreAntiforgeryToken]
9+
public class ErrorModel : PageModel
10+
{
11+
public string? RequestId { get; set; }
12+
13+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14+
15+
private readonly ILogger<ErrorModel> _logger;
16+
17+
public ErrorModel(ILogger<ErrorModel> logger)
18+
{
19+
_logger = logger;
20+
}
21+
22+
public void OnGet()
23+
{
24+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25+
}
26+
}
27+
28+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@page
2+
@model Blog.FrontEnd.blogPage.blogModel
3+
@{
4+
<input type="text" />
5+
<input type="submit">
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace Blog.FrontEnd.blogPage
5+
{
6+
public class blogModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@page
2+
@model Blog.FrontEnd.homePage.homeModel
3+
@{
4+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace Blog.FrontEnd.homePage
5+
{
6+
public class homeModel : PageModel
7+
{
8+
public void OnGet()
9+
{
10+
}
11+
}
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@page
2+
@model Blog.FrontEnd.loginPage.loginModel
3+
@{
4+
<input type="text" />
5+
<input type="text" />
6+
<input type="submit" />
7+
}

0 commit comments

Comments
 (0)