ContentResult vs. string

Ich vor kurzem gefragt wurde, warum ContentResult anstatt string. Leider konnte ich keine bessere Antwort als: "Es ist die beste Praxis."

Hat jemand eine bessere Antwort?

Besser zu verstehen, die Frage. Was ist der Unterschied?

public ActionResult Foo(){
    return Content("Some string");
}

public string Bar(){
    return "Some string";
}
InformationsquelleAutor Tobias | 2013-08-28
Schreibe einen Kommentar