Разрешил null в моделях бд

This commit is contained in:
Никита Потапов 2024-05-29 13:55:20 +04:00
parent 92e74d1d7d
commit d1fc181b08
6 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,7 @@ namespace PolyclinicDatabaseImplement.Models
public int CourseId { get; set; }
[Required]
public int DiagnoseId { get; set; }
public virtual Course Course { get; set; } = new();
public virtual Diagnose Diagnose { get; set; } = new();
public virtual Course? Course { get; set; }
public virtual Diagnose? Diagnose { get; set; }
}
}

View File

@ -17,7 +17,7 @@ namespace PolyclinicDatabaseImplement.Models
public DateTime DateStartDiagnose { get; set; } = DateTime.Now;
public DateTime? DateStopDiagnose { get; set; }
public int Id { get; set; }
public virtual User User { get; set; } = new();
public virtual User? User { get; set; }
public static Diagnose? Create(DiagnoseBindingModel? model)
{

View File

@ -19,7 +19,7 @@ namespace PolyclinicDatabaseImplement.Models
[Required]
public DateTime DateStartProcedure { get; set; } = DateTime.Now;
public DateTime? DateStopProcedure { get; set; }
public virtual User User { get; set; } = new();
public virtual User? User { get; set; }
public string? Comment { get; set; } = string.Empty;

View File

@ -9,7 +9,7 @@ namespace PolyclinicDatabaseImplement.Models
public int ProcedureId { get; set; }
[Required]
public int RecipeId { get; set; }
public virtual Procedure Procedure { get; set; } = new();
public virtual Recipe Recipe { get; set; } = new();
public virtual Procedure? Procedure { get; set; }
public virtual Recipe? Recipe { get; set; }
}
}

View File

@ -9,7 +9,7 @@ namespace PolyclinicDatabaseImplement.Models
public int SymptomId { get; set; }
[Required]
public int DiagnoseId { get; set; }
public virtual Symptom Symptom { get; set; } = new();
public virtual Diagnose Diagnose { get; set; } = new();
public virtual Symptom? Symptom { get; set; }
public virtual Diagnose? Diagnose { get; set; }
}
}

View File

@ -9,7 +9,7 @@ namespace PolyclinicDatabaseImplement.Models
public int SymptomId { get; set; }
[Required]
public int RecipeId { get; set; }
public virtual Symptom Symptom { get; set; } = new();
public virtual Recipe Recipe { get; set; } = new();
public virtual Symptom? Symptom { get; set; }
public virtual Recipe? Recipe { get; set; }
}
}