Created
October 28, 2011 21:08
-
-
Save detroitpro/1323568 to your computer and use it in GitHub Desktop.
Sample Action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using System.Web.Mvc.Ajax; | |
| namespace Application | |
| { | |
| public class Sample : Controller | |
| { | |
| public Sample(ISampleService sampleService){ | |
| _sampleService = sampleService; | |
| } | |
| public ActionResult Details(int Id){ | |
| var vm = new SampleDetailsViewModel(); | |
| var complexResult = _sampleService.DoSomethingGreaterThanDataAccess(Id); | |
| if(complexResult.Success){ | |
| vm = Mapper.Map<ComplexResultType, SampleDetailsViewModel>(complexResult); | |
| } | |
| return View(vm); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment