I have seen this related question Creating and Simple Class and Calling a Method from a cshtml File. How can we do that without using the App_Code folder?
In my project's root, I have a Something.cs class:
public class Something
{
public static void DoIt()
{
}
}
In my project's root, I also have index.cshtml with the following code:
@Something.DoIt()
The name Something
does not exist in the current context of index.cshtml.