фиксим ощибки №2
This commit is contained in:
parent
78c8a27dd0
commit
62a9d2d48e
@ -39,7 +39,7 @@ namespace VeterinaryDatabaseImplement.Models
|
||||
public virtual List<DrugMedication> Medications { get; set; } = new();
|
||||
[ForeignKey("DrugId")]
|
||||
public virtual List<Purchase> Purchases { get; set; } = new();
|
||||
public static Drug Create(VeterinaryDataBase context, DrugBindingModel model)
|
||||
public static Drug Create(VeterinaryDatabase context, DrugBindingModel model)
|
||||
{
|
||||
return new Drug()
|
||||
{
|
||||
@ -66,7 +66,7 @@ namespace VeterinaryDatabaseImplement.Models
|
||||
Price = Price,
|
||||
DrugMedications = DrugMedications
|
||||
};
|
||||
public void UpdateMedications(VeterinaryDataBase context, DrugBindingModel model)
|
||||
public void UpdateMedications(VeterinaryDatabase context, DrugBindingModel model)
|
||||
{
|
||||
var drugMedications = context.DrugMedications.Where(rec => rec.DrugId == model.Id).ToList();
|
||||
if (drugMedications != null && drugMedications.Count > 0)
|
||||
|
@ -39,7 +39,7 @@ namespace VeterinaryDatabaseImplement.Models
|
||||
}
|
||||
[ForeignKey("ServiceId")]
|
||||
public virtual List<ServiceMedication> Medications { get; set; } = new();
|
||||
public static Service Create(VeterinaryDataBase context, ServiceBindingModel model)
|
||||
public static Service Create(VeterinaryDatabase context, ServiceBindingModel model)
|
||||
{
|
||||
return new Service()
|
||||
{
|
||||
@ -67,7 +67,7 @@ namespace VeterinaryDatabaseImplement.Models
|
||||
ServiceMedications = ServiceMedications
|
||||
};
|
||||
|
||||
public void UpdateMedications(VeterinaryDataBase context, ServiceBindingModel model)
|
||||
public void UpdateMedications(VeterinaryDatabase context, ServiceBindingModel model)
|
||||
{
|
||||
var serviceMedications = context.ServiceMedications.Where(rec => rec.ServiceId == model.Id).ToList();
|
||||
if (serviceMedications != null && serviceMedications.Count > 0)
|
||||
|
@ -16,10 +16,10 @@ namespace VeterinaryDatabaseImplement
|
||||
}
|
||||
public virtual DbSet<Doctor> Doctors { set; get; }
|
||||
public virtual DbSet<Drug> Drugs { set; get; }
|
||||
public virtual DbSet<Medication> Medication { set; get; }
|
||||
public virtual DbSet<Medication> Medications { set; get; }
|
||||
public virtual DbSet<Service> Services { set; get; }
|
||||
public virtual DbSet<ServiceMedication> ServiceMedicationes { set; get; }
|
||||
public virtual DbSet<DrugMedication> DrugMedicationes{ set; get; }
|
||||
public virtual DbSet<ServiceMedication> ServiceMedications { set; get; }
|
||||
public virtual DbSet<DrugMedication> DrugMedications{ set; get; }
|
||||
public virtual DbSet<Owner> Owners { set; get; }
|
||||
public virtual DbSet<Pet> Pets { set; get; }
|
||||
public virtual DbSet<Visit> Visits { set; get; }
|
||||
|
Loading…
Reference in New Issue
Block a user