diff --git a/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs b/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs index 65841af..4b67e42 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs @@ -14,6 +14,7 @@ namespace PolyclinicDatabaseImplement.Models [Required] public int UserId { get; private set; } public int Id { get; private set; } + public static Diagnose? Create(DiagnoseBindingModel? model) { if (model == null) diff --git a/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs b/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs index 4b1aca3..67f88e5 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs @@ -17,6 +17,7 @@ namespace PolyclinicDatabaseImplement.Models [Required] public UserRole Role { get; private set; } = UserRole.Неизвестный; public int Id { get; private set; } + public static User? Create(UserBindingModel? model) { if (model == null) @@ -28,6 +29,7 @@ namespace PolyclinicDatabaseImplement.Models FIO = model.FIO, Email = model.Email, Password = model.Password, + Role = model.Role, Id = model.Id }; } @@ -41,6 +43,7 @@ namespace PolyclinicDatabaseImplement.Models FIO = model.FIO; Email = model.Email; Password = model.Password; + Role = model.Role; FIO = model.FIO; } @@ -49,6 +52,7 @@ namespace PolyclinicDatabaseImplement.Models FIO = FIO, Email = Email, Password = Password, + Role = Role, Id = Id }; }