What's this syntax in this object instantiation
This screenshot is straight from MimeKit's quick start guide here: https://mimekit.net/docs/html/Creating-Messages.htm
I understand
body
is being declared as a new object of type TextPart. The constructor is being passed the string "plain"
, but next to that: that bracketed block, what's the C# structure/syntax being used here? How is that Text
variable assignment in the block being associated to the body object?
I'd like to look it up but I'm not sure what to go reading about. Can I have some super beginner help? 🙂4 Replies
Initializer syntax
Angius
REPL Result: Success
Result: int
Compile: 281.771ms | Execution: 38.247ms | React with ❌ to remove this embed.
It basically compiles down to
As a side note, if you use a raw string literal (or whatever the triple-quoted string is called) you can have this large string indented better:
That got me right to the microsoft learn page I need to read. Thank you!