From 78af8e86e980872f3ef050395769f867a9ec6ba6 Mon Sep 17 00:00:00 2001 From: mfnefd Date: Tue, 4 Jun 2024 11:57:28 +0400 Subject: [PATCH] Binding Search View models --- Contracts/BindingModels/RoleBindingModel.cs | 14 ++++++++++++++ Contracts/BindingModels/UserBindingModel.cs | 19 +++++++++++++++++++ Contracts/Contracts.csproj | 3 --- Contracts/SearchModels/RoleSearchModel.cs | 13 +++++++++++++ Contracts/SearchModels/UserSearchModel.cs | 14 ++++++++++++++ Contracts/ViewModels/RoleViewModel.cs | 14 ++++++++++++++ Contracts/ViewModels/UserViewModel.cs | 19 +++++++++++++++++++ 7 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 Contracts/BindingModels/RoleBindingModel.cs create mode 100644 Contracts/BindingModels/UserBindingModel.cs create mode 100644 Contracts/SearchModels/RoleSearchModel.cs create mode 100644 Contracts/SearchModels/UserSearchModel.cs create mode 100644 Contracts/ViewModels/RoleViewModel.cs create mode 100644 Contracts/ViewModels/UserViewModel.cs diff --git a/Contracts/BindingModels/RoleBindingModel.cs b/Contracts/BindingModels/RoleBindingModel.cs new file mode 100644 index 0000000..8e33f73 --- /dev/null +++ b/Contracts/BindingModels/RoleBindingModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.BindingModels +{ + public class RoleBindingModel + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/Contracts/BindingModels/UserBindingModel.cs b/Contracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..7b6c7c6 --- /dev/null +++ b/Contracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.BindingModels +{ + public class UserBindingModel + { + public Guid Id { get; set; } + public string FirstName { get; set; } = string.Empty; + public string SecondName { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string PasswordHash { get; set; } = string.Empty; + public DateTime Birthday { get; set; } + public RoleBindingModel Role { get; set; } = null!; + } +} \ No newline at end of file diff --git a/Contracts/Contracts.csproj b/Contracts/Contracts.csproj index 13d76fe..64eaa86 100644 --- a/Contracts/Contracts.csproj +++ b/Contracts/Contracts.csproj @@ -7,9 +7,6 @@ - - - diff --git a/Contracts/SearchModels/RoleSearchModel.cs b/Contracts/SearchModels/RoleSearchModel.cs new file mode 100644 index 0000000..058eda2 --- /dev/null +++ b/Contracts/SearchModels/RoleSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.SearchModels +{ + public class RoleSearchModel + { + public Guid? Id { get; set; } + } +} \ No newline at end of file diff --git a/Contracts/SearchModels/UserSearchModel.cs b/Contracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..2df2131 --- /dev/null +++ b/Contracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.SearchModels +{ + public class UserSearchModel + { + public Guid? Id { get; set; } + public string? Email { get; set; } + } +} \ No newline at end of file diff --git a/Contracts/ViewModels/RoleViewModel.cs b/Contracts/ViewModels/RoleViewModel.cs new file mode 100644 index 0000000..98d5c6f --- /dev/null +++ b/Contracts/ViewModels/RoleViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.ViewModels +{ + public class RoleViewModel + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/Contracts/ViewModels/UserViewModel.cs b/Contracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..4f15600 --- /dev/null +++ b/Contracts/ViewModels/UserViewModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.ViewModels +{ + public class UserViewModel + { + public Guid Id { get; set; } + public string FirstName { get; set; } = string.Empty; + public string SecondName { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string PasswordHash { get; set; } = string.Empty; + public DateTime Birthday { get; set; } + public RoleViewModel Role { get; set; } = null!; + } +} \ No newline at end of file