Refactoring - split data, logic and model layers; custom network exception

This commit is contained in:
Dimitar Byalkov
2023-05-12 12:13:11 +02:00
parent 81109f3d6c
commit ee0b063eec
48 changed files with 256 additions and 160 deletions

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
namespace Models
{
public class User
{
private int id;
private string name;
private string password;
private UserRole role;
public User(int id, string name, string password, UserRole role)
{
ID = id;
Name = name;
Password = password;
Role = role;
}
public User()
{
}
public int ID
{
get; private set;
}
public string Name
{
get => name;
set => name = value;
}
[DataType(DataType.Password)]
public string Password
{
get => password;
set => password = value;
}
public UserRole Role
{
get => role;
set => role = value;
}
public override string ToString()
{
return $"{ID}: {Name} ({Role})";
}
}
}