static void Main() { var bc = new BookCollection(); bc.ListBooks(); ref var book = ref bc.GetBookByTitle("Call of the Wild, The"); // ref local
public static void RefUse() { var bc = new BookCollection(); bc.ListBooks(); ref var book = ref bc.GetBookByTitle("Call of the wild, The");
// This method displays the following output: // Original values in Main. Name: Fasteners, ID: 54321 // Back in Main. Name: Stapler, ID: 12345 // </Snippet3> private static void BookCollectionExample() { // <Snippet5> var bc = new BookCollection(); bc.ListBooks(); ref var book = ref bc.GetBookByTitle("Call of the Wild, The");
static void Main(string[] args) { var bc = new BookCollection(); bc.ListBooks(); var index = -1; ref var book = ref bc.GetBookByTitle("Call of the Wild, The", ref index);