I recently was asked why to use ContentResult
instead of returning string
. Unfortunately I could not give a better answer than: "It is best practice."
Does anyone have a better answer?
To better understand the question. What's the difference?
public ActionResult Foo(){
return Content("Some string");
}
public string Bar(){
return "Some string";
}