What would be a ‘non-console application’ representation of the following code.
class Sword
{
public void Hit(string target)
{
Console.WriteLine("Chopped {0} clean in half", target);
}
}
I can’t seem to figure out what this code would look like in a C# ASP.NET MVC project.
and then you could have a controller:
and a corresponding view:
I have strictly no idea why your question is tagged with Ninject, but if you want to use Ninject in an ASP.NET MVC application you may install the
Ninject.MVC3NuGet package and go through some tutorials such as this one for example.