Commit e5ee2aee authored by Yevgeniy Agrafenin's avatar Yevgeniy Agrafenin

#2 Подключил пакет библиотек для реализации проекта. Добавил модель пользователя…

#2 Подключил пакет библиотек для реализации проекта. Добавил модель пользователя и модели представления Регистрации и Входа.
parent 715e7d2c
...@@ -6,4 +6,13 @@ ...@@ -6,4 +6,13 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
</ItemGroup>
</Project> </Project>
using Microsoft.AspNetCore.Identity;
namespace CafeCritic.Models;
public class User: IdentityUser
{
}
\ No newline at end of file
using System.ComponentModel.DataAnnotations;
namespace CafeCritic.ViewModels;
public class LoginViewModel
{
[Required(ErrorMessage = "Для входа, поле обязательно для заполниния.")]
[Display(Name = "Email аккаунта.")]
public string Email { get; set; }
[Required(ErrorMessage = "Введите пароль")]
[DataType(DataType.Password)]
public string Password { get; set; }
[Display(Name = "Запомнить?")]
public bool RememberMe { get; set; }
public string? ReturnUrl { get; set; }
}
\ No newline at end of file
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
namespace CafeCritic.ViewModels;
public class RegisterViewModel
{
[Required(ErrorMessage = "Для регистрации введите Email")]
[DataType(DataType.EmailAddress)]
public string Email { get; set; }
[Required(ErrorMessage = "Введите пароль")]
[DataType(DataType.Password)]
public string Password { get; set; }
[Compare("Password", ErrorMessage = "Пароли не совпадают")]
[DataType(DataType.Password)]
public string ConfirmPassword { get; set; }
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment