public Product Get(string sku) { var item = _productStore.Get(sku); if (string.IsNullOrEmpty(item.Details)) { // testing extension method for merging a model with a partial model; item.SetValues(new { Details = "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>", IgnoreMe = ":)" }); } return(item); }
public Product Get([FromHeader] string auth, [FromRoute] string prod) { string user; if ((user = JwtBuilder.UserJwtToken(auth).Result) == null || !UserStore.Exists(user).Result) { HttpContext.Response.StatusCode = (int)HttpStatusCode.Unauthorized; return(null); } HttpContext.Response.Headers.Add("auth", auth); var product = ProductStore.Get(prod).Result; if (product != null) { return(product); } HttpContext.Response.StatusCode = (int)HttpStatusCode.NotFound; return(null); }