-
Book Overview & Buying
-
Table Of Contents
ASP.NET Core MVC 2.0 Cookbook
By :
In this recipe, you will learn how to use ActionResult to return with a Web API. ActionResult is a core type of MVC for returning a result from server to client. ActionResult is a base class and its abstract, so we can use one of the derived classes of it, such as JsonResult, ViewResult, RedirectResult, or FileResult.
We will create a Web API controller with the CRUD method to understand what ActionResult we have to return for each HTTP verb.
With ASP.NET Core MVC and Web API-merging, the base class is now the same. ActionResults now returns the HTTP status code result, as the ApiController base class returned before ASP.NET Core.
We will use ActionResults to return the HTTP status code with a CRUD Web API controller:
"Microsoft.AspNetCore.MVC": "2.0.0",
Startup.cs...
Change the font size
Change margin width
Change background colour