Правки связей миграции
This commit is contained in:
parent
99f3839cba
commit
dd23035e4c
@ -14,7 +14,7 @@ namespace FurnitureAssemblyDatabaseImplement
|
|||||||
{
|
{
|
||||||
if (optionsBuilder.IsConfigured == false)
|
if (optionsBuilder.IsConfigured == false)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseSqlServer(@"Data Source=KatanaNik\SQLEXPRESS;Initial Catalog=FurnitureAssemblyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=FurnitureAssemblyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnConfiguring(optionsBuilder);
|
base.OnConfiguring(optionsBuilder);
|
||||||
|
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(FurnitureAssemblyDatabase))]
|
[DbContext(typeof(FurnitureAssemblyDatabase))]
|
||||||
[Migration("20240422061349_Initial")]
|
[Migration("20240511191901_InitialCreate")]
|
||||||
partial class Initial
|
partial class InitialCreate
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@ -220,7 +220,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Implementer", "Implementer")
|
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Implementer", "Implementer")
|
||||||
.WithMany("Orders")
|
.WithMany("Order")
|
||||||
.HasForeignKey("ImplementerId");
|
.HasForeignKey("ImplementerId");
|
||||||
|
|
||||||
b.Navigation("Client");
|
b.Navigation("Client");
|
||||||
@ -244,7 +244,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Implementer", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Implementer", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Orders");
|
b.Navigation("Order");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
namespace FurnitureAssemblyDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Initial : Migration
|
public partial class InitialCreate : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -217,7 +217,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Implementer", "Implementer")
|
b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Implementer", "Implementer")
|
||||||
.WithMany("Orders")
|
.WithMany("Order")
|
||||||
.HasForeignKey("ImplementerId");
|
.HasForeignKey("ImplementerId");
|
||||||
|
|
||||||
b.Navigation("Client");
|
b.Navigation("Client");
|
||||||
@ -241,7 +241,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Implementer", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Implementer", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Orders");
|
b.Navigation("Order");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b =>
|
||||||
|
@ -29,7 +29,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models
|
|||||||
|
|
||||||
// Для реализации связи один ко многим с заказами
|
// Для реализации связи один ко многим с заказами
|
||||||
[ForeignKey("ImplementerId")]
|
[ForeignKey("ImplementerId")]
|
||||||
public virtual List<Order> Orders { get; set; } = new();
|
public virtual List<Order> Order { get; set; } = new();
|
||||||
|
|
||||||
public static Implementer? Create(ImplementerBindingModel model)
|
public static Implementer? Create(ImplementerBindingModel model)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user