main.cs296 chars8 lines
Explanation:
We start by creating a new context object, MyContext
, which should inherit from DbContext
.
We then use the Max
method to retrieve the highest score from the HighScore
column of the Players
table.
Next, we use the Where
method to retrieve the player(s) with the highest score. We only expect one player, so we use the First
method to select the first item in the result set.
Finally, we use Console.WriteLine
to print out a congratulatory message with the name of the player and their high score.
gistlibby LogSnag