C#C
C#3y ago
Avis

Object that's passed in isn't recognized as an object?

using System;
using System.Collections.Generic;

class Program {
  public static void Main (string[] args) {
    List<Lot> auction = new List<Lot>();

    mainMenu(auction);
  }

  public void mainMenu(List<Lot> lots) {
    Lot currentLot = null;
    ...

  }
}


I'm getting an error saying An object reference is required for the non-static field, method, or property 'Program.mainMenu(List<Lot>)' When I try to call mainMenu() in my main method. Am I not passing the auction variable correctly?
Was this page helpful?