title: Dependency injection error message
body: <p>I am learning dependency injection with a small example. I am getting the error message "object reference not set to an instance of an object" from the ProcessOrder() method below on this line: </p>
  
  <pre><code>_iordProc.ProcessOrder(popOrder);
  </code></pre>
  
  <p>What am I doing wrong? Do I need to provide a parameterless constructor?</p>
  
  <p>Here is my code... </p>
  
  <pre><code>public interface IOrderProcessingEngine
  {
      void ProcessOrder(Order objOrder);
      void EmailOrder(Order objEmailOrd);
  }
  
  public class Order
  {
      public String OrderId { get; set; }
      public decimal Amount { get; set; }
      public String  OrderDate { get; set; }
      public String DeliveryDate { get; set; }
      public String FirstName { get; set; }
      public String LastName { get; set; }
  }
  
  public class OrderProcessingEngine : IOrderProcessingEngine
  {
      public void ProcessOrder(Order objOrder)
      {
          Console.WriteLine("This method will process my order which is very cool");
      }
  
      public void EmailOrder(Order objEmailOrd)
      {
          Console.WriteLine("This method will send email to the customers");
      }
  }
  
  public class OrderService
  {
      //Dependency Injection
      private readonly IOrderProcessingEngine _iordProc;
  
      public OrderService(IOrderProcessingEngine objOrdproc)
      {
          _iordProc = objOrdproc;
      }
  
      public OrderService()
      {
  
      }
  
      public void ProcessOrder(Order popOrder)
      {
          //Getting an error here on next line -- object reference not set to an instance of an object
          _iordProc.ProcessOrder(popOrder);
          _iordProc.EmailOrder(popOrder);
      }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          Order myOrder = new Order();
          myOrder.OrderId = "1001";
          myOrder.Amount = 2000;
          myOrder.OrderDate = "05/22/2015";
          myOrder.DeliveryDate = "05/30/2015";
          myOrder.FirstName = "Johnson";
          myOrder.LastName = "Adoga";
  
          OrderService objOrdServ = new OrderService();
          objOrdServ.ProcessOrder(myOrder);
  
          Console.ReadLine();
      }
  }
  </code></pre>