Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Created November 28, 2017 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HamidMosalla/a5a66c3ed14dd3dc7febab033a2fd8ed to your computer and use it in GitHub Desktop.
Save HamidMosalla/a5a66c3ed14dd3dc7febab033a2fd8ed to your computer and use it in GitHub Desktop.
[HttpGet]
public async Task<IActionResult> Detail(int id)
{
if (id == default(int)) return BadRequest();
var model = await _mediator.Send(new PortfolioByIdQuery { PortfolioId = id });
if (model == null) return NotFound();
var viewModel = _mapper.Map<Portfolio, PortfolioViewModel>(model);
return View(viewModel);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment