Изменены модификаторы доступа к полям можелей бд

This commit is contained in:
Никита Потапов 2024-04-28 16:09:47 +04:00
parent d34842b466
commit 289fd1c593
3 changed files with 15 additions and 11 deletions

View File

@ -8,13 +8,13 @@ namespace PolyclinicDatabaseImplement.Models
public class Diagnose : IDiagnoseModel
{
[Required]
public string Name { get; private set; } = string.Empty;
public string Name { get; set; } = string.Empty;
[Required]
public string Comment { get; private set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
[Required]
public int UserId { get; private set; }
public int Id { get; private set; }
public virtual User? User { get; private set; }
public int UserId { get; set; }
public int Id { get; set; }
public virtual User? User { get; set; }
public static Diagnose? Create(DiagnoseBindingModel? model)
{

View File

@ -9,14 +9,14 @@ namespace PolyclinicDatabaseImplement.Models
public class User : IUserModel
{
[Required]
public string FIO { get; private set; } = string.Empty;
public string FIO { get; set; } = string.Empty;
[Required]
public string Email { get; private set; } = string.Empty;
public string Email { get; set; } = string.Empty;
[Required]
public string Password { get; private set; } = string.Empty;
public string Password { get; set; } = string.Empty;
[Required]
public UserRole Role { get; private set; } = UserRole.Неизвестный;
public int Id { get; private set; }
public UserRole Role { get; set; } = UserRole.Неизвестный;
public int Id { get; set; }
public static User? Create(UserBindingModel? model)
{

View File

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using PolyclinicDatabaseImplement.Models;
namespace SecuritySystemDatabaseImplement
{
@ -12,6 +13,9 @@ namespace SecuritySystemDatabaseImplement
}
base.OnConfiguring(optionsBuilder);
}
//public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<User> Users { set; get; }
public virtual DbSet<Diagnose> Diagnoses { set; get; }
public virtual DbSet<Course> Courses { set; get; }
public virtual DbSet<CourseDiagnose> CourseDiagnoses { set; get; }
}
}