Show / Hide Table of Contents

Class ItemController

In the Model-View-Controller pattern, the controller processes the input. In this case, it is all the input involving item operations. The most important method is the IndexAsync(String), which returns a list of items.

Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Microsoft.AspNetCore.Mvc.Controller
ItemController
Implements
Microsoft.AspNetCore.Mvc.Filters.IActionFilter
Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter
Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
System.IDisposable
Namespace: Scrapbook101core.Controllers
Assembly: Scrapbook101core.dll
Syntax
public class ItemController : Controller, IActionFilter, IAsyncActionFilter, IFilterMetadata, IDisposable

Constructors

| Improve this Doc View Source

ItemController(IWebHostEnvironment)

Declaration
public ItemController(IWebHostEnvironment hostingEnvironment)
Parameters
Type Name Description
Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnvironment

Methods

| Improve this Doc View Source

CreateAsync()

Declaration
[ActionName("Create")]
public async Task<ActionResult> CreateAsync()
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

CreateAsync(CombinedModel)

Declaration
[HttpPost]
[ActionName("Create")]
[ValidateAntiForgeryToken]
public async Task<ActionResult> CreateAsync(CombinedModel combinedModel)
Parameters
Type Name Description
CombinedModel combinedModel
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

DeleteAsync(String)

Declaration
[HttpGet]
[ActionName("Delete")]
public async Task<ActionResult> DeleteAsync(string id)
Parameters
Type Name Description
System.String id
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

DeleteConfirmedAsync(String)

Declaration
[HttpPost]
[ActionName("Delete")]
public async Task<ActionResult> DeleteConfirmedAsync([Bind(new string[]{"Id"})] string id)
Parameters
Type Name Description
System.String id
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

DetailsAsync(String)

Declaration
[ActionName("Details")]
public async Task<ActionResult> DetailsAsync(string id)
Parameters
Type Name Description
System.String id
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

EditAsync(CombinedModel)

Declaration
[HttpPost]
[ActionName("Edit")]
[ValidateAntiForgeryToken]
public async Task<ActionResult> EditAsync(CombinedModel combinedModel)
Parameters
Type Name Description
CombinedModel combinedModel
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

EditAsync(String)

Declaration
[HttpGet]
[ActionName("Edit")]
public async Task<ActionResult> EditAsync(string id)
Parameters
Type Name Description
System.String id
Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>
| Improve this Doc View Source

IndexAsync(String)

Returns items based that contain the specified string. Note that for demonstration, the functionality is purposely limited. The string could also be found in description field. Similarly, more parameters can be added to expand the possibility of the searches.

Declaration
[ActionName("Index")]
public async Task<ActionResult> IndexAsync(string filter)
Parameters
Type Name Description
System.String filter

A string to find in titles.

Returns
Type Description
System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>

A list of matching items

Implements

Microsoft.AspNetCore.Mvc.Filters.IActionFilter
Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter
Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX for Scrapbook101Core on