OK. I'm now instantiating the object. However, I'm not assigning anything to the repository variables so they are null when orderService.SearchOrders is called.
Here is my code (the important bit anyway)
...
using Nop.Core;
using Nop.Data;
using Nop.Services;
using Nop.Services.Orders;
using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Shipping;
using Nop.Core.Domain.Payments;
using Nop.Core.Data;
using Nop.Core.Events;
namespace WpfApplication3
{
public partial class MainWindow : Window
{
private readonly IOrderProcessingService _orderProcessingService;
private readonly IOrderService _orderService;
private readonly IRepository<Order> _orderRepository;
private readonly IRepository<OrderProductVariant> _opvRepository;
private readonly IRepository<OrderNote> _orderNoteRepository;
private readonly IRepository<ProductVariant> _pvRepository;
private readonly IRepository<RecurringPayment> _recurringPaymentRepository;
private readonly IRepository<RecurringPaymentHistory> _recurringPaymentHistoryRepository;
private readonly IRepository<Customer> _customerRepository;
private readonly IRepository<ReturnRequest> _returnRequestRepository;
private readonly IEventPublisher _eventPublisher;
public MainWindow()
{
InitializeComponent();
}
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
OrderStatus? orderStatus = (OrderStatus?)(20);
PaymentStatus? paymentStatus = (PaymentStatus?)(30);
ShippingStatus? shippingStatus = (ShippingStatus?)(20);
OrderService orderService = new OrderService(_orderRepository,_opvRepository, _orderNoteRepository, _pvRepository, _recurringPaymentRepository, _recurringPaymentHistoryRepository, _customerRepository, _returnRequestRepository, _eventPublisher);
this.lstbxOrders.ItemsSource = orderService.SearchOrders(null, null, orderStatus, paymentStatus, shippingStatus, "", "", 0, 1000);
}
What do I need to assign to each of the repository varaible.
private readonly IRepository<Order> _orderRepository = ????;
Thanks again for your help. I'll be waiting with bated breath making good use of f5