вторая

This commit is contained in:
Nastya_Kozlova 2024-03-19 19:12:55 +04:00
parent 34c284b74d
commit 5606c50ef1
2 changed files with 2 additions and 8 deletions

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;
}