The @
character allows you to give your variables names that are reserved as keywords. A common and useful use case for this is:
public static void AnExtensionMethod(this SomeObject @this)
{
@this.AMethod();
}
In your example the @
seems obsolete in C# as Do
is not a keyword (do
is). It is in VB.NET though, so if this interface will be consumed by VB.NET clients it is needed. In your case it is fine only if there really wasn't any better name for the method than Do
. As it is now it seems not very readable. Conceptually "package.do" can mean anything so you can call it x
as well. But maybe in your domain language this is a more precise term.
The documentation states:
The prefix "@" enables the use of keywords as identifiers, which is useful when interfacing with other programming languages. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, without the prefix. An identifier with an @ prefix is called a verbatim identifier. Use of the @ prefix for identifiers that are not keywords is permitted, but strongly discouraged as a matter of style.