I have a few related questions about method scope in C#, and best case usage in ASP.Net:
public by itself means this is an instance-based member that is accessible to external callers (those with access to the type itself).
static by itself means the member is not instance-based: you can call it without needing any particular instance (or even any instance at all); without an accessibility qualifier, non-public is assumed - so the member will not be accessible to external callers.
public static is a
static method that is accessible to external callers.
Memory usage is identical in both cases: any variables declared in the method are scoped to the method-call itself (as an implementation detail: via the stack; also: I'm assuming no "captured variables", and no
Nothing in this is specific to ASP.NET / MVC. However, "action" methods on controllers are, IIRC, expected to be public / instance, so with the
public modifier, and without the
Static / etc: