public async Task <ResourceOrder> GetOrderByIdAsync(int orderId)
        {
            var order = await _resourceOrdersRepository.GetByIdAsync(orderId);

            if (order != null)
            {
                order.Department = await _departmentsService.GetDepartmentByIdAsync(order.DepartmentId);

                var items = await _resourceOrderItemRepository.GetAllItemsByResourceItemIdAsync(orderId);

                if (items != null && items.Any())
                {
                    order.Items = items.ToList();
                }
                else
                {
                    order.Items = new List <ResourceOrderItem>();
                }
            }

            return(order);
        }
 public async Task <ResourceOrder> GetOrderByIdAsync(int orderId)
 {
     return(await _resourceOrdersRepository.GetByIdAsync(orderId));
 }