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:
9
docs/guides/entities/samples/unboxing.cs
Normal file
9
docs/guides/entities/samples/unboxing.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
IUser user;
|
||||
|
||||
// Here we use inline unboxing to make a call to its member (if available) only once.
|
||||
|
||||
// Note that if the entity we're trying to cast to is null, this will throw a NullReferenceException.
|
||||
Console.WriteLine(((IGuildUser)user).Nickname);
|
||||
|
||||
// In case you are certain the entity IS said member, you can also use unboxing to declare variables.
|
||||
IGuildUser guildUser = (IGuildUser)user;
|
||||
Reference in New Issue
Block a user