From 6c2a55ae403c77f8ecb94a20a38a755d34a4a5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Thu, 6 Apr 2023 22:44:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BC=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/RepairRequestStorage.cs | 4 +- .../Implements/VehicleStorage.cs | 4 +- .../Implements/WorkInRequestStorage.cs | 4 +- .../Implements/WorkPaymentStorage.cs | 4 +- .../CarServiceDatabase/Models/Customer.cs | 1 - CarService/CarServiceDatabase/Models/Item.cs | 2 - .../Models/ItemForRepair.cs | 6 +- .../Models/RepairRequest.cs | 10 +- .../CarServiceDatabase/Models/Vehicle.cs | 10 +- CarService/CarServiceDatabase/Models/Work.cs | 2 - .../Models/WorkInRequest.cs | 10 +- .../CarServiceDatabase/Models/WorkPayment.cs | 10 +- .../CarServiceDatabase/Models/Worker.cs | 1 - .../CarServiceView/CarServiceView.csproj | 6 + .../FormItemForRepairTest.Designer.cs | 1 + .../CarServiceView/FormItemForRepairTest.cs | 10 ++ .../FormUpdateItemForRepairTest.Designer.cs | 132 ++++++++++++++++++ .../FormUpdateItemForRepairTest.cs | 55 ++++++++ .../FormUpdateItemForRepairTest.resx | 60 ++++++++ CarService/CarServiceView/Program.cs | 3 +- 20 files changed, 292 insertions(+), 43 deletions(-) create mode 100644 CarService/CarServiceView/FormUpdateItemForRepairTest.Designer.cs create mode 100644 CarService/CarServiceView/FormUpdateItemForRepairTest.cs create mode 100644 CarService/CarServiceView/FormUpdateItemForRepairTest.resx diff --git a/CarService/CarServiceDatabase/Implements/RepairRequestStorage.cs b/CarService/CarServiceDatabase/Implements/RepairRequestStorage.cs index 5a26d9a..f54c511 100644 --- a/CarService/CarServiceDatabase/Implements/RepairRequestStorage.cs +++ b/CarService/CarServiceDatabase/Implements/RepairRequestStorage.cs @@ -41,7 +41,7 @@ namespace CarServiceDatabase.Implements public RepairRequestViewModel? Insert(RepairRequestBindingModel model) { using var context = new CarServiceDbContext(); - var newRepairRequest = RepairRequest.Create(model); + var newRepairRequest = RepairRequest.Create(context, model); if (newRepairRequest != null) { context.RepairRequests.Add(newRepairRequest); @@ -58,7 +58,7 @@ namespace CarServiceDatabase.Implements { return null; } - repairRequest.Update(model); + repairRequest.Update(context, model); context.SaveChanges(); return repairRequest.GetViewModel; } diff --git a/CarService/CarServiceDatabase/Implements/VehicleStorage.cs b/CarService/CarServiceDatabase/Implements/VehicleStorage.cs index 052ae49..0c027be 100644 --- a/CarService/CarServiceDatabase/Implements/VehicleStorage.cs +++ b/CarService/CarServiceDatabase/Implements/VehicleStorage.cs @@ -39,7 +39,7 @@ namespace CarServiceDatabase.Implements public VehicleViewModel? Insert(VehicleBindingModel model) { using var context = new CarServiceDbContext(); - var newVehicle = Vehicle.Create(model); + var newVehicle = Vehicle.Create(context, model); if (newVehicle != null) { context.Vehicles.Add(newVehicle); @@ -57,7 +57,7 @@ namespace CarServiceDatabase.Implements { return null; } - vehicle.Update(model); + vehicle.Update(context, model); context.SaveChanges(); return vehicle.GetViewModel; } diff --git a/CarService/CarServiceDatabase/Implements/WorkInRequestStorage.cs b/CarService/CarServiceDatabase/Implements/WorkInRequestStorage.cs index d066068..11de59c 100644 --- a/CarService/CarServiceDatabase/Implements/WorkInRequestStorage.cs +++ b/CarService/CarServiceDatabase/Implements/WorkInRequestStorage.cs @@ -41,7 +41,7 @@ namespace CarServiceDatabase.Implements public WorkInRequestViewModel? Insert(WorkInRequestBindingModel model) { using var context = new CarServiceDbContext(); - var newWorkInRequest = WorkInRequest.Create(model); + var newWorkInRequest = WorkInRequest.Create(context, model); if (newWorkInRequest != null) { context.WorksInRequest.Add(newWorkInRequest); @@ -58,7 +58,7 @@ namespace CarServiceDatabase.Implements { return null; } - workInRequest.Update(model); + workInRequest.Update(context, model); context.SaveChanges(); return workInRequest.GetViewModel; } diff --git a/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs b/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs index 953b47a..5bc657a 100644 --- a/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs +++ b/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs @@ -40,7 +40,7 @@ namespace CarServiceDatabase.Implements public WorkPaymentViewModel? Insert(WorkPaymentBindingModel model) { using var context = new CarServiceDbContext(); - var newWorkPayment = WorkPayment.Create(model); + var newWorkPayment = WorkPayment.Create(context, model); if (newWorkPayment != null) { context.WorkPayments.Add(newWorkPayment); @@ -57,7 +57,7 @@ namespace CarServiceDatabase.Implements { return null; } - workPayment.Update(model); + workPayment.Update(context, model); context.SaveChanges(); return workPayment.GetViewModel; } diff --git a/CarService/CarServiceDatabase/Models/Customer.cs b/CarService/CarServiceDatabase/Models/Customer.cs index fcbae4c..ab90c2c 100644 --- a/CarService/CarServiceDatabase/Models/Customer.cs +++ b/CarService/CarServiceDatabase/Models/Customer.cs @@ -30,7 +30,6 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Login = model.Login, Password = model.Password, Name = model.Name, diff --git a/CarService/CarServiceDatabase/Models/Item.cs b/CarService/CarServiceDatabase/Models/Item.cs index 4d8c058..780cbf7 100644 --- a/CarService/CarServiceDatabase/Models/Item.cs +++ b/CarService/CarServiceDatabase/Models/Item.cs @@ -31,7 +31,6 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Name = model.Name, Price = model.Price, Count = model.Count, @@ -44,7 +43,6 @@ namespace CarServiceDatabase.Models { return; } - Id = model.Id; Name = model.Name; Price = model.Price; Count = model.Count; diff --git a/CarService/CarServiceDatabase/Models/ItemForRepair.cs b/CarService/CarServiceDatabase/Models/ItemForRepair.cs index 2fe70d7..60a1132 100644 --- a/CarService/CarServiceDatabase/Models/ItemForRepair.cs +++ b/CarService/CarServiceDatabase/Models/ItemForRepair.cs @@ -24,7 +24,6 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Count = model.Count, Item = context.Items.First(x => x.Id == model.ItemId), RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId) @@ -36,10 +35,9 @@ namespace CarServiceDatabase.Models { return; } - Id = model.Id; Count = model.Count; - ItemId = model.ItemId; - RepairRequestId = model.RepairRequestId; + Item = context.Items.First(x => x.Id == model.ItemId); + RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId); } public ItemForRepairViewModel GetViewModel => new() { diff --git a/CarService/CarServiceDatabase/Models/RepairRequest.cs b/CarService/CarServiceDatabase/Models/RepairRequest.cs index a65572f..a7ab094 100644 --- a/CarService/CarServiceDatabase/Models/RepairRequest.cs +++ b/CarService/CarServiceDatabase/Models/RepairRequest.cs @@ -24,7 +24,7 @@ namespace CarServiceDatabase.Models [ForeignKey("RepairRequestId")] public virtual List ItemsForRepair { get; set; } = new(); public virtual Vehicle Vehicle { get; set; } = new(); - public static RepairRequest? Create(RepairRequestBindingModel? model) + public static RepairRequest? Create(CarServiceDbContext context, RepairRequestBindingModel? model) { if (model == null) { @@ -32,20 +32,18 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, DateCreated = model.DateCreated, - VehicleId = model.VehicleId + Vehicle = context.Vehicles.First(x => x.Id == model.VehicleId) }; } - public void Update(RepairRequestBindingModel? model) + public void Update(CarServiceDbContext context, RepairRequestBindingModel? model) { if (model == null) { return; } - Id = model.Id; DateCreated = model.DateCreated; - VehicleId = model.VehicleId; + Vehicle = context.Vehicles.First(x => x.Id == model.VehicleId); } public RepairRequestViewModel GetViewModel => new() { diff --git a/CarService/CarServiceDatabase/Models/Vehicle.cs b/CarService/CarServiceDatabase/Models/Vehicle.cs index 76b7c1c..861b1c8 100644 --- a/CarService/CarServiceDatabase/Models/Vehicle.cs +++ b/CarService/CarServiceDatabase/Models/Vehicle.cs @@ -21,7 +21,7 @@ namespace CarServiceDatabase.Models [ForeignKey("VehicleId")] public virtual List RepairRequests { get; set; } = new(); public virtual Customer Customer { get; set; } = new(); - public static Vehicle? Create(VehicleBindingModel? model) + public static Vehicle? Create(CarServiceDbContext context, VehicleBindingModel? model) { if (model == null) { @@ -29,24 +29,22 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Name = model.Name, Plate = model.Plate, VIN = model.VIN, - CustomerId = model.CustomerId + Customer = context.Customers.First(x => x.Id == model.CustomerId) }; } - public void Update(VehicleBindingModel? model) + public void Update(CarServiceDbContext context, VehicleBindingModel? model) { if (model == null) { return; } - Id = model.Id; Name = model.Name; Plate = model.Plate; VIN = model.VIN; - CustomerId = model.CustomerId; + Customer = context.Customers.First(x => x.Id == model.CustomerId); } public VehicleViewModel GetViewModel => new() { diff --git a/CarService/CarServiceDatabase/Models/Work.cs b/CarService/CarServiceDatabase/Models/Work.cs index a32215b..92e2927 100644 --- a/CarService/CarServiceDatabase/Models/Work.cs +++ b/CarService/CarServiceDatabase/Models/Work.cs @@ -31,7 +31,6 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Name = model.Name, Price = model.Price, Duration = model.Duration, @@ -44,7 +43,6 @@ namespace CarServiceDatabase.Models { return; } - Id = model.Id; Name = model.Name; Price = model.Price; Duration = model.Duration; diff --git a/CarService/CarServiceDatabase/Models/WorkInRequest.cs b/CarService/CarServiceDatabase/Models/WorkInRequest.cs index 6e9f82e..f484371 100644 --- a/CarService/CarServiceDatabase/Models/WorkInRequest.cs +++ b/CarService/CarServiceDatabase/Models/WorkInRequest.cs @@ -24,7 +24,7 @@ namespace CarServiceDatabase.Models public virtual List WorkPayments { get; set; } = new(); public virtual RepairRequest RepairRequest { get; set; } = new(); public virtual Work Work { get; set; } = new(); - public static WorkInRequest? Create(WorkInRequestBindingModel? model) + public static WorkInRequest? Create(CarServiceDbContext context, WorkInRequestBindingModel? model) { if (model == null) { @@ -32,24 +32,22 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Count = model.Count, Cost = model.Cost, RepairRequestId = model.RepairRequestId, - WorkId = model.WorkId + Work = context.Works.First(x => x.Id == model.WorkId) }; } - public void Update(WorkInRequestBindingModel? model) + public void Update(CarServiceDbContext context, WorkInRequestBindingModel? model) { if (model == null) { return; } - Id = model.Id; Count = model.Count; Cost = model.Cost; RepairRequestId = model.RepairRequestId; - WorkId = model.WorkId; + Work = context.Works.First(x => x.Id == model.WorkId); } public WorkInRequestViewModel GetViewModel => new() { diff --git a/CarService/CarServiceDatabase/Models/WorkPayment.cs b/CarService/CarServiceDatabase/Models/WorkPayment.cs index e47f8d1..e64c72b 100644 --- a/CarService/CarServiceDatabase/Models/WorkPayment.cs +++ b/CarService/CarServiceDatabase/Models/WorkPayment.cs @@ -17,7 +17,7 @@ namespace CarServiceDatabase.Models [Required] public int WorkInRequestId { get; private set; } public virtual WorkInRequest WorkInRequest { get; set; } = new(); - public static WorkPayment? Create(WorkPaymentBindingModel? model) + public static WorkPayment? Create(CarServiceDbContext context, WorkPaymentBindingModel? model) { if (model == null) { @@ -25,22 +25,20 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, DatePayment = model.DatePayment, Sum = model.Sum, - WorkInRequestId = model.WorkInRequestId + WorkInRequest = context.WorksInRequest.First(x => x.Id == model.WorkInRequestId) }; } - public void Update(WorkPaymentBindingModel? model) + public void Update(CarServiceDbContext context, WorkPaymentBindingModel? model) { if (model == null) { return; } - Id = model.Id; DatePayment = model.DatePayment; Sum = model.Sum; - WorkInRequestId = model.WorkInRequestId; + WorkInRequest = context.WorksInRequest.First(x => x.Id == model.WorkInRequestId); } public WorkPaymentViewModel GetViewModel => new() { diff --git a/CarService/CarServiceDatabase/Models/Worker.cs b/CarService/CarServiceDatabase/Models/Worker.cs index da0ff0f..35d19f7 100644 --- a/CarService/CarServiceDatabase/Models/Worker.cs +++ b/CarService/CarServiceDatabase/Models/Worker.cs @@ -35,7 +35,6 @@ namespace CarServiceDatabase.Models } return new() { - Id = model.Id, Login = model.Login, Password = model.Password, Name = model.Name, diff --git a/CarService/CarServiceView/CarServiceView.csproj b/CarService/CarServiceView/CarServiceView.csproj index 66aaf25..9c48f80 100644 --- a/CarService/CarServiceView/CarServiceView.csproj +++ b/CarService/CarServiceView/CarServiceView.csproj @@ -31,4 +31,10 @@ + + + Form + + + \ No newline at end of file diff --git a/CarService/CarServiceView/FormItemForRepairTest.Designer.cs b/CarService/CarServiceView/FormItemForRepairTest.Designer.cs index f6924a1..692bb15 100644 --- a/CarService/CarServiceView/FormItemForRepairTest.Designer.cs +++ b/CarService/CarServiceView/FormItemForRepairTest.Designer.cs @@ -61,6 +61,7 @@ this.updateToolStripMenuItem.Name = "updateToolStripMenuItem"; this.updateToolStripMenuItem.Size = new System.Drawing.Size(73, 20); this.updateToolStripMenuItem.Text = "Изменить"; + this.updateToolStripMenuItem.Click += new System.EventHandler(this.updateToolStripMenuItem_Click); // // deleteToolStripMenuItem // diff --git a/CarService/CarServiceView/FormItemForRepairTest.cs b/CarService/CarServiceView/FormItemForRepairTest.cs index 468ed6e..9af9602 100644 --- a/CarService/CarServiceView/FormItemForRepairTest.cs +++ b/CarService/CarServiceView/FormItemForRepairTest.cs @@ -33,5 +33,15 @@ namespace CarServiceView LoadData(); } } + + private void updateToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormUpdateItemForRepairTest)); + if (service is FormUpdateItemForRepairTest form) + { + form.ShowDialog(); + LoadData(); + } + } } } diff --git a/CarService/CarServiceView/FormUpdateItemForRepairTest.Designer.cs b/CarService/CarServiceView/FormUpdateItemForRepairTest.Designer.cs new file mode 100644 index 0000000..db4e451 --- /dev/null +++ b/CarService/CarServiceView/FormUpdateItemForRepairTest.Designer.cs @@ -0,0 +1,132 @@ +namespace CarServiceView +{ + partial class FormUpdateItemForRepairTest + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonUpdate = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.textBoxCount = new System.Windows.Forms.TextBox(); + this.comboBoxRepairRequest = new System.Windows.Forms.ComboBox(); + this.comboBoxItem = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // buttonUpdate + // + this.buttonUpdate.Location = new System.Drawing.Point(36, 125); + this.buttonUpdate.Name = "buttonUpdate"; + this.buttonUpdate.Size = new System.Drawing.Size(75, 23); + this.buttonUpdate.TabIndex = 9; + this.buttonUpdate.Text = "Обновить"; + this.buttonUpdate.UseVisualStyleBackColor = true; + this.buttonUpdate.Click += new System.EventHandler(this.buttonUpdate_Click); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 67); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(72, 15); + this.label3.TabIndex = 6; + this.label3.Text = "Количество"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 38); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(80, 15); + this.label2.TabIndex = 7; + this.label2.Text = "Статья затрат"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(44, 15); + this.label1.TabIndex = 8; + this.label1.Text = "Заявка"; + // + // textBoxCount + // + this.textBoxCount.Location = new System.Drawing.Point(110, 64); + this.textBoxCount.Name = "textBoxCount"; + this.textBoxCount.Size = new System.Drawing.Size(100, 23); + this.textBoxCount.TabIndex = 3; + // + // comboBoxRepairRequest + // + this.comboBoxRepairRequest.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxRepairRequest.FormattingEnabled = true; + this.comboBoxRepairRequest.Location = new System.Drawing.Point(110, 12); + this.comboBoxRepairRequest.Name = "comboBoxRepairRequest"; + this.comboBoxRepairRequest.Size = new System.Drawing.Size(121, 23); + this.comboBoxRepairRequest.TabIndex = 10; + // + // comboBoxItem + // + this.comboBoxItem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxItem.FormattingEnabled = true; + this.comboBoxItem.Location = new System.Drawing.Point(110, 38); + this.comboBoxItem.Name = "comboBoxItem"; + this.comboBoxItem.Size = new System.Drawing.Size(121, 23); + this.comboBoxItem.TabIndex = 10; + // + // FormUpdateItemForRepairTest + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.comboBoxItem); + this.Controls.Add(this.comboBoxRepairRequest); + this.Controls.Add(this.buttonUpdate); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBoxCount); + this.Name = "FormUpdateItemForRepairTest"; + this.Text = "FormAddItemForRepairTest"; + this.Load += new System.EventHandler(this.FormAddItemForRepairTest_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Button buttonUpdate; + private Label label3; + private Label label2; + private Label label1; + private TextBox textBoxCount; + private ComboBox comboBoxRepairRequest; + private ComboBox comboBoxItem; + } +} \ No newline at end of file diff --git a/CarService/CarServiceView/FormUpdateItemForRepairTest.cs b/CarService/CarServiceView/FormUpdateItemForRepairTest.cs new file mode 100644 index 0000000..61b6053 --- /dev/null +++ b/CarService/CarServiceView/FormUpdateItemForRepairTest.cs @@ -0,0 +1,55 @@ +using CarServiceContracts.BusinessLogicsContracts; + +namespace CarServiceView +{ + public partial class FormUpdateItemForRepairTest : Form + { + IItemLogic _itemLogic; + IRepairRequestLogic _repairRequestLogic; + IItemForRepairLogic _itemForRepairLogic; + public FormUpdateItemForRepairTest(IItemLogic itemLogic, IRepairRequestLogic repairRequestLogic, IItemForRepairLogic itemForRepairLogic) + { + _itemLogic = itemLogic; + _repairRequestLogic = repairRequestLogic; + _itemForRepairLogic = itemForRepairLogic; + InitializeComponent(); + } + + private void FormAddItemForRepairTest_Load(object sender, EventArgs e) + { + LoadData(); + } + private void LoadData() + { + //загружаем заказы + var listRR = _repairRequestLogic.ReadList(null); + if (listRR != null) + { + comboBoxRepairRequest.DisplayMember = "Id"; + comboBoxRepairRequest.ValueMember = "Id"; + comboBoxRepairRequest.DataSource = listRR; + comboBoxRepairRequest.SelectedItem = null; + } + //загружаем статьи затрат + var listI = _itemLogic.ReadList(null); + if (listI != null) + { + comboBoxItem.DisplayMember = "Name"; + comboBoxItem.ValueMember = "Id"; + comboBoxItem.DataSource = listI; + comboBoxItem.SelectedItem = null; + } + } + + private void buttonUpdate_Click(object sender, EventArgs e) + { + _itemForRepairLogic.Update(new() + { + Id = 1, + Count = Convert.ToInt32(textBoxCount.Text), + ItemId = Convert.ToInt32(comboBoxItem.SelectedValue), + RepairRequestId = Convert.ToInt32(comboBoxRepairRequest.SelectedValue) + }); + } + } +} diff --git a/CarService/CarServiceView/FormUpdateItemForRepairTest.resx b/CarService/CarServiceView/FormUpdateItemForRepairTest.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/CarService/CarServiceView/FormUpdateItemForRepairTest.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/CarService/CarServiceView/Program.cs b/CarService/CarServiceView/Program.cs index a944472..4fd414b 100644 --- a/CarService/CarServiceView/Program.cs +++ b/CarService/CarServiceView/Program.cs @@ -19,7 +19,7 @@ namespace CarServiceView var services = new ServiceCollection(); ConfigureServices(services); _serviceProvider = services.BuildServiceProvider(); - Application.Run(_serviceProvider.GetRequiredService()); + Application.Run(_serviceProvider.GetRequiredService()); } private static void ConfigureServices(ServiceCollection services) { @@ -51,6 +51,7 @@ namespace CarServiceView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file