фиксим ошибки

This commit is contained in:
antoc0der 2024-04-25 00:02:05 +04:00
parent e2bef71132
commit 57600bd351
3 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ namespace VeterinaryDatabaseImplement.Models
public virtual List<PurchasePet> Pets { get; set; } = new();
[ForeignKey("PurchaseId")]
public virtual List<Drug> Drugs { get; set; } = new();
public static Purchase? Create(VeterenaryDatabase context, PurchaseBindingModel model)
public static Purchase? Create(VeterinaryDatabase context, PurchaseBindingModel model)
{
return new Purchase()
{

View File

@ -32,7 +32,7 @@ namespace VeterinaryDatabaseImplement.Models
}
[ForeignKey("VisitId")]
public virtual List<VisitPet> Pets { get; set; } = new();
public static Visit? Create(VisitVeterenaryDatabase context, VisitBindingModel model)
public static Visit? Create(VeterinaryDatabase context, VisitBindingModel model)
{
return new Visit()
{

View File

@ -3,13 +3,13 @@ using VeterinaryDatabaseImplement.Models;
namespace VeterinaryDatabaseImplement
{
public class VeterenaryDatabase : DbContext
public class VeterinaryDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=VeterenaryDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=VeterinaryDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"
);
}
base.OnConfiguring(optionsBuilder);