мелкие правки
This commit is contained in:
parent
f933bb4258
commit
44d0c40065
@ -117,4 +117,4 @@ namespace VetClinicDataBaseImplement.Implements
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace VetClinicDataBaseImplement.Models
|
||||
public virtual List<VisitAnimal> Animals { get; set; } = new();
|
||||
|
||||
[ForeignKey("VisitId")]
|
||||
public virtual List<ServiceVisit> Services { get; set; } = new();
|
||||
public virtual List<VisitService> 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),
|
||||
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicDataBaseImplement.Models
|
||||
{
|
||||
public class ServiceVisit
|
||||
public class VisitService
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[Required]
|
@ -18,7 +18,7 @@ namespace VetClinicDataBaseImplement
|
||||
public virtual DbSet<Animal> Animals { set; get; }
|
||||
public virtual DbSet<Admin> Admins { set; get; }
|
||||
public virtual DbSet<VisitAnimal> VisitAnimals { set; get; }
|
||||
public virtual DbSet<ServiceVisit> ServiceVisits { set; get; }
|
||||
public virtual DbSet<VisitService> ServiceVisits { set; get; }
|
||||
public virtual DbSet<Visit> Visits { set; get; }
|
||||
public virtual DbSet<Vaccination> Vaccinations { set; get; }
|
||||
public virtual DbSet<Pharmacist> Pharmacists { set; get; }
|
||||
|
Loading…
Reference in New Issue
Block a user