C# Class SampleWebApp.Controllers.PostsController

This is an example of a Controller using GenericServices database commands with a DTO. In this case we are using normal, non-async commands
Inheritance: Controller
Show file Open project: JonPSmith/SampleMvcWebApp

Public Methods

Method Description
CodeView ( ) : System.Web.Mvc.ActionResult
Create ( ICreateSetupService setupService ) : System.Web.Mvc.ActionResult
Delay ( ) : System.Web.Mvc.ActionResult
Delete ( int id, IDeleteService service ) : System.Web.Mvc.ActionResult
Details ( int id, IDetailService service ) : System.Web.Mvc.ActionResult
Edit ( int id, IUpdateSetupService service ) : System.Web.Mvc.ActionResult
GetNumPosts ( SampleWebAppDb db ) : string
Index ( int id, IListService service ) : System.Web.Mvc.ActionResult

Note that is Index is different in that it has an optional id to filter the list on.

NumPosts ( SampleWebAppDb db ) : System.Web.Mvc.ActionResult
Reset ( SampleWebAppDb db ) : System.Web.Mvc.ActionResult

Private Methods

Method Description
Create ( DetailPostDto dto, ICreateService service ) : System.Web.Mvc.ActionResult
Edit ( DetailPostDto dto, IUpdateService service ) : System.Web.Mvc.ActionResult

Method Details

CodeView() public method

public CodeView ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult

Create() public method

public Create ( ICreateSetupService setupService ) : System.Web.Mvc.ActionResult
setupService ICreateSetupService
return System.Web.Mvc.ActionResult

Delay() public method

public Delay ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult

Delete() public method

public Delete ( int id, IDeleteService service ) : System.Web.Mvc.ActionResult
id int
service IDeleteService
return System.Web.Mvc.ActionResult

Details() public method

public Details ( int id, IDetailService service ) : System.Web.Mvc.ActionResult
id int
service IDetailService
return System.Web.Mvc.ActionResult

Edit() public method

public Edit ( int id, IUpdateSetupService service ) : System.Web.Mvc.ActionResult
id int
service IUpdateSetupService
return System.Web.Mvc.ActionResult

GetNumPosts() public static method

public static GetNumPosts ( SampleWebAppDb db ) : string
db DataLayer.DataClasses.SampleWebAppDb
return string

Index() public method

Note that is Index is different in that it has an optional id to filter the list on.
public Index ( int id, IListService service ) : System.Web.Mvc.ActionResult
id int
service IListService
return System.Web.Mvc.ActionResult

NumPosts() public method

public NumPosts ( SampleWebAppDb db ) : System.Web.Mvc.ActionResult
db DataLayer.DataClasses.SampleWebAppDb
return System.Web.Mvc.ActionResult

Reset() public method

public Reset ( SampleWebAppDb db ) : System.Web.Mvc.ActionResult
db DataLayer.DataClasses.SampleWebAppDb
return System.Web.Mvc.ActionResult