diff --git a/VetClinic/VetClinicDataBaseImplement/Implements/VisitStorage.cs b/VetClinic/VetClinicDataBaseImplement/Implements/VisitStorage.cs index 417bb8b..4ecbbf4 100644 --- a/VetClinic/VetClinicDataBaseImplement/Implements/VisitStorage.cs +++ b/VetClinic/VetClinicDataBaseImplement/Implements/VisitStorage.cs @@ -117,4 +117,4 @@ namespace VetClinicDataBaseImplement.Implements } } } -} + diff --git a/VetClinic/VetClinicDataBaseImplement/Models/Visit.cs b/VetClinic/VetClinicDataBaseImplement/Models/Visit.cs index 6516c87..e68a0a3 100644 --- a/VetClinic/VetClinicDataBaseImplement/Models/Visit.cs +++ b/VetClinic/VetClinicDataBaseImplement/Models/Visit.cs @@ -32,7 +32,7 @@ namespace VetClinicDataBaseImplement.Models public virtual List Animals { get; set; } = new(); [ForeignKey("VisitId")] - public virtual List Services { get; set; } = new(); + public virtual List Services { get; set; } = new(); public virtual Admin Admin { get; set; } @@ -77,7 +77,7 @@ namespace VetClinicDataBaseImplement.Models { Animal = context.Animals.First(y => y.Id == x.Key) }).ToList(), - Services = model.ServiceVisits.Select(x => new ServiceVisit + Services = model.ServiceVisits.Select(x => new VisitService { Service = context.Services.First(y => y.Id == x.Key) }).ToList(), @@ -136,7 +136,7 @@ namespace VetClinicDataBaseImplement.Models var visit = context.Visits.First(x => x.Id == Id); foreach (var pc in model.ServiceVisits) { - context.ServiceVisits.Add(new ServiceVisit + context.ServiceVisits.Add(new VisitService { Visit = visit, Service = context.Services.First(x => x.Id == pc.Key), diff --git a/VetClinic/VetClinicDataBaseImplement/Models/ServiceVisit.cs b/VetClinic/VetClinicDataBaseImplement/Models/VisitService.cs similarity index 94% rename from VetClinic/VetClinicDataBaseImplement/Models/ServiceVisit.cs rename to VetClinic/VetClinicDataBaseImplement/Models/VisitService.cs index 4d53dcc..7dd986d 100644 --- a/VetClinic/VetClinicDataBaseImplement/Models/ServiceVisit.cs +++ b/VetClinic/VetClinicDataBaseImplement/Models/VisitService.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace VetClinicDataBaseImplement.Models { - public class ServiceVisit + public class VisitService { public int Id { get; set; } [Required] diff --git a/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs b/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs index c490c60..e3aa818 100644 --- a/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs +++ b/VetClinic/VetClinicDataBaseImplement/VetClinicDatabase .cs @@ -18,7 +18,7 @@ namespace VetClinicDataBaseImplement public virtual DbSet Animals { set; get; } public virtual DbSet Admins { set; get; } public virtual DbSet VisitAnimals { set; get; } - public virtual DbSet ServiceVisits { set; get; } + public virtual DbSet ServiceVisits { set; get; } public virtual DbSet Visits { set; get; } public virtual DbSet Vaccinations { set; get; } public virtual DbSet Pharmacists { set; get; }