diff --git a/Layout/NavMenu.razor b/Layout/NavMenu.razor
index 4580018..9b3f3af 100644
--- a/Layout/NavMenu.razor
+++ b/Layout/NavMenu.razor
@@ -14,6 +14,11 @@
Home
+
+
+ Register
+
+
Counter
diff --git a/Models/ViewModels/ServiceResponse.cs b/Models/ViewModels/ServiceResponse.cs
new file mode 100644
index 0000000..a518d53
--- /dev/null
+++ b/Models/ViewModels/ServiceResponse.cs
@@ -0,0 +1,8 @@
+namespace Sandbox.Models.ViewModels;
+
+public class ServiceResponse
+{
+ public T? Data { get; set; }
+ public bool Success { get; set; } = true;
+ public string Message { get; set; } = string.Empty;
+}
\ No newline at end of file
diff --git a/Models/ViewModels/UserRegister.cs b/Models/ViewModels/UserRegister.cs
new file mode 100644
index 0000000..ca10717
--- /dev/null
+++ b/Models/ViewModels/UserRegister.cs
@@ -0,0 +1,10 @@
+namespace Sandbox.Models.ViewModels;
+
+public class UserRegister
+{
+ public string Email { get; set; } = string.Empty;
+ //[Required, StringLength(100, MinimumLength = 5)]
+ public string Password { get; set; } = string.Empty;
+ //[Compare("Password", ErrorMessage = "The password do not match.")]
+ public string ConfirmPassword { get; set; } = string.Empty;
+}
\ No newline at end of file
diff --git a/Pages/Account/Register.razor b/Pages/Account/Register.razor
new file mode 100644
index 0000000..d34d21b
--- /dev/null
+++ b/Pages/Account/Register.razor
@@ -0,0 +1,62 @@
+@page "/register"
+@using Sandbox.Services.AuthService
+@using Sandbox.Models.ViewModels
+
+@* @inject AuthenticationStateProvider AuthenticationStateProvider *@
+@* @inject NavigationManager NavigationManager *@
+@inject IAuthService AuthService
+
+Register
+
+
+
+
+
+
Register Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @errorMessage
+
+
+
+ @message
+
+
+@code {
+ UserRegister user = new();
+
+ private string message = string.Empty;
+ private string messageCssClass = string.Empty;
+ private string errorMessage = string.Empty;
+
+ async void HandleRegistration()
+ {
+ var result = await AuthService.Register(user.Email, user.Password);
+ message = result.Message;
+ messageCssClass = result.Success ? "text-success" : "text-danger";
+ }
+}
\ No newline at end of file
diff --git a/Program.cs b/Program.cs
index 2a393cc..91f6dc9 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
-using blazor_mini_sandbox;
+using Sandbox;
+using Sandbox.Services.AuthService;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add("#app");
@@ -8,4 +9,6 @@ builder.RootComponents.Add("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
+builder.Services.AddScoped();
+
await builder.Build().RunAsync();
diff --git a/Services/AuthService/AuthService.cs b/Services/AuthService/AuthService.cs
new file mode 100644
index 0000000..f855537
--- /dev/null
+++ b/Services/AuthService/AuthService.cs
@@ -0,0 +1,16 @@
+using Sandbox.Models.ViewModels;
+
+namespace Sandbox.Services.AuthService;
+
+public class AuthService : IAuthService
+{
+ public async Task> Register(string userName, string password)
+ {
+ return new ServiceResponse
+ {
+ Data = 1,
+ Message = $"Got register request with user name {userName}",
+ Success = true
+ };
+ }
+}
\ No newline at end of file
diff --git a/Services/AuthService/IAuthService.cs b/Services/AuthService/IAuthService.cs
new file mode 100644
index 0000000..83bf777
--- /dev/null
+++ b/Services/AuthService/IAuthService.cs
@@ -0,0 +1,8 @@
+using Sandbox.Models.ViewModels;
+
+namespace Sandbox.Services.AuthService;
+
+public interface IAuthService
+{
+ Task> Register(string userName, string password);
+}
\ No newline at end of file
diff --git a/_Imports.razor b/_Imports.razor
index 2924ceb..f9d7903 100644
--- a/_Imports.razor
+++ b/_Imports.razor
@@ -6,5 +6,5 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
-@using blazor_mini_sandbox
-@using blazor_mini_sandbox.Layout
+@using Sandbox
+@using Sandbox.Layout
diff --git a/blazor-mini-sandbox.csproj b/blazor-mini-sandbox.csproj
index 5414cff..891bf17 100644
--- a/blazor-mini-sandbox.csproj
+++ b/blazor-mini-sandbox.csproj
@@ -5,6 +5,7 @@
enable
enable
true
+ Sandbox