Skip to content

Commit

Permalink
doc: Update property received checking to make use of Discards (#651)
Browse files Browse the repository at this point in the history
* Update property received checking to make use of Discards 

Since C# 7.0 you can use Discards.

https://docs.microsoft.com/en-us/dotnet/csharp/discards
  • Loading branch information
rugk authored Mar 27, 2021
1 parent 21f061b commit 680df07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/help/_posts/2010-03-01-received-calls.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ calculator.Mode = "TEST";

//Check received call to property getter
//We need to assign the result to a variable to keep
//the compiler happy.
var temp = calculator.Received().Mode;
//the compiler happy or use discards (since C# 7.0).
_ = calculator.Received().Mode;

//Check received call to property setter with arg of "TEST"
calculator.Received().Mode = "TEST";
Expand Down

0 comments on commit 680df07

Please sign in to comment.