I'm attempting to put line breaks in the following method chain in VB.NET, but I have the syntax incorrect:
HasRequired(Function(x) x.Issue).WithMany(Function(x) x.EntityNotes).HasForeignKey(Function(x) x.IssueID)
I would like something similar to:
HasRequired(Function(x) x.Issue)
.WithMany(Function(x) x.EntityNotes)
.HasForeignKey(Function(x) x.IssueID)
In VB.Net, you used to always need _
to continue a line. This is now often optional, but can always be added:
HasRequired(Function(x) x.Issue) _
.WithMany(Function(x) x.EntityNotes) _
.HasForeignKey(Function(x) x.IssueID)
As of Visual Studio 2010, however, you can leave this off in many cases, and the compiler will correctly determine whether the new "line" is part of the preceeding line.
This is covered under Typographic and Code Conventions in the language documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With