Реализовал все модели смежных таблиц многие ко многим

This commit is contained in:
Никита Потапов 2024-04-29 20:49:12 +04:00
parent 5805b378b4
commit 7bb90df611
2 changed files with 12 additions and 5 deletions

View File

@ -5,13 +5,11 @@ namespace PolyclinicDatabaseImplement.Models
public class ProcedureRecipe public class ProcedureRecipe
{ {
public int Id { get; set; } public int Id { get; set; }
[Required] [Required]
public int ProcedureId { get; set; } public int ProcedureId { get; set; }
[Required] [Required]
public int RecipeId { get; set; } public int RecipeId { get; set; }
public virtual Procedure Procedure { get; set; } public virtual Procedure Procedure { get; set; } = new();
public virtual Recipe Recipe { get; set; } public virtual Recipe Recipe { get; set; } = new();
} }
} }

View File

@ -1,6 +1,15 @@
namespace PolyclinicDatabaseImplement.Models using System.ComponentModel.DataAnnotations;
namespace PolyclinicDatabaseImplement.Models
{ {
public class SymptomRecipe public class SymptomRecipe
{ {
public int Id { get; set; }
[Required]
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();
} }
} }