Christopher Caldwell
Christopher Caldwell

Reputation: 335

Unable to identify some C# syntax for translation to VB.NET

I'm translating some example code line by line from C# to VB.NET.

The lines which confuse me looks like this:

[Kernel(CustomFallbackMethod = "AddCpu")] 

I see in the code that these lines appear just before the method declaration:

private static void

What kind of line appears before a method declaration? Or is it a continuation of the last? I hope this is obvious to a native C Sharper.

Upvotes: 3

Views: 296

Answers (1)

Andrew T Finnell
Andrew T Finnell

Reputation: 13628

It's an Attribute. It's a way to mark up code that can be used at runtime or compile time.

I would google VB.NET and Attributes. You can read some passages here on O'Reilly

Your example would be converted to:

       <Kernel(CustomFallbackMethod:="AddCpu")>

Be sure to use _ if you decide to put it on the line before your method.

Upvotes: 4

Related Questions