Skip to content

Instantly share code, notes, and snippets.

@jchannon
Created September 27, 2015 17:40
Show Gist options
  • Save jchannon/f9b2e2091449819ec2a0 to your computer and use it in GitHub Desktop.
Save jchannon/f9b2e2091449819ec2a0 to your computer and use it in GitHub Desktop.
public class ProductController : Controller
{
private IMediate _mediator;
public ProductController(IMediate mediator)
{
_mediator = mediator;
}
public ViewResult ProductDetails(ProductDetailQuery query)
{
var model = _mediator.Request(query);
return View(model);
}
}
@daanl
Copy link

daanl commented Sep 27, 2015

public ViewResult ProductDetails([FromUri] ProductDetailQuery query)
{
    var model = _mediator.Request(query);
    return View(model);
}

@josephwoodward
Copy link

Oh that's cool. Didn't know you could use the [FromUri] attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment