PIbd-22. Kozlova A.A. Lab work 02 #2

Closed
Nastya_Kozlova wants to merge 2 commits from lab2_base into lab1_base
2 changed files with 2 additions and 8 deletions
Showing only changes of commit 5606c50ef1 - Show all commits

View File

@ -39,10 +39,8 @@ namespace PrecastConcretePlantFileImplement.Implements
{
return null;
}
return source.Components
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName ==
model.ComponentName) ||
(model.Id.HasValue && x.Id == model.Id))
return source.Components.FirstOrDefault(x => (!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName ==
model.ComponentName) || (model.Id.HasValue && x.Id == model.Id))
?.GetViewModel;
}
public ComponentViewModel? Insert(ComponentBindingModel model)

View File

@ -93,10 +93,6 @@ namespace PrecastConcretePlantFileImplement.Implements
private OrderViewModel AddReinforcedName(OrderViewModel model)
{
var selectedReinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.ReinforcedId);
if (selectedReinforced != null)
{
model.ReinforcedName = selectedReinforced.ReinforcedName;
}
model.ReinforcedName = selectedReinforced?.ReinforcedName;
return model;
}