Правки.

This commit is contained in:
Андрей Байгулов 2024-03-17 20:49:37 +04:00
parent a55f771ecf
commit 25869a56bf

View File

@ -79,8 +79,8 @@ namespace SushiBarFileImplement.Implements
private OrderViewModel? AttachSushiName(OrderViewModel? model)
{
var sushi = source.Sushis.FirstOrDefault(x => x.Id == model?.SushiId);
model?.GetType().GetProperty("SushiName")?.SetValue(model, sushi?.SushiName);
var sushi = model?.SushiId != null ? source.Sushis.FirstOrDefault(x => x.Id == model.SushiId) : null;
model.SushiName = sushi?.SushiName;
return model;
}
}