Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ASP.NET MVC 4 を使用しており、HttpStatusCode 列挙値に見つからないステータス コード 420 を返す必要があります。
通常は簡単です。次のようにします。
return Request.CreateResponse(HttpStatusCode.InternalServerError, error);
しかし、必要なステータス コードの列挙値がない場合はどうすればよいでしょうか。
次のようなものを試してください:
return new HttpStatusCodeResult(420,"My message");
MSDNに関するその他のリファレンス。