diff --git a/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs b/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs index 3220716..93cbffe 100644 --- a/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs +++ b/LawFirm/LawFirmFileImplement/Implements/OrderStorage.cs @@ -86,13 +86,10 @@ namespace LawFirmFileImplement.Implements private OrderViewModel GetViewModel(Order order) { var viewModel = order.GetViewModel; - foreach (var document in source.Documents) + var document = source.Documents.FirstOrDefault(x => x.Id == order.DocumentId); + if (document != null) { - if (document.Id == order.DocumentId) - { - viewModel.DocumentName = document.DocumentName; - break; - } + viewModel.DocumentName = document.DocumentName; } return viewModel; }