Adding Entity guides, flowcharts, better sample system. (#2054)
* initial * Interaction glossary entry * Sharded Interaction sample * Renames into solution * Debugging samples * Modify target location for webhookclient * Finalizing docs work, resolving docfx errors. * Adding threaduser to user chart * Add branch info to readme. * Edits to user chart * Resolve format for glossary entries * Patch sln target * Issue with file naming fixed * Patch 1/x for builds * Appending suggestions
This commit is contained in:
10
docs/guides/entities/samples/safety-cast-pass.cs
Normal file
10
docs/guides/entities/samples/safety-cast-pass.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
private void MyFunction(IMessage message)
|
||||
{
|
||||
// Here we do the reverse as in the previous examples, and let it continue the code below if it IS an IUserMessage
|
||||
if (message is not IUserMessage userMessage)
|
||||
return;
|
||||
|
||||
// Because we do the above check inline (don't give the statement a body),
|
||||
// the code will still declare `userMessage` as available outside of the above statement.
|
||||
Console.WriteLine(userMessage.Author);
|
||||
}
|
||||
Reference in New Issue
Block a user