Skip to content

Commit 8591b02

Browse files
Oops
1 parent 7eaf161 commit 8591b02

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

14/umbraco-cms/reference/mapping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,21 +246,21 @@ public class ProductsController : Controller
246246
public ProductsController(IUmbracoMapper mapper) => _mapper = mapper;
247247

248248
[HttpGet("getall")]
249-
public HttpResponseMessage GetAll()
249+
public IActionResult GetAll()
250250
{
251251
var products = FakeServiceCall();
252252
var mapped = _mapper.MapEnumerable<Product, ProductDto>(products);
253253

254-
return Request.CreateResponse(HttpStatusCode.OK, mapped);
254+
return Ok(mapped);
255255
}
256256

257257
[HttpGet("getfirstproduct")]
258-
public HttpResponseMessage GetFirstProduct()
258+
public IActionResult GetFirstProduct()
259259
{
260260
var product = FakeServiceCall().First();
261261
var mapped = _mapper.Map<ProductDto>(product);
262262

263-
return Request.CreateResponse(HttpStatusCode.OK, mapped);
263+
return Ok(mapped);
264264
}
265265

266266
private IEnumerable<Product> FakeServiceCall()

15/umbraco-cms/reference/mapping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,21 +246,21 @@ public class ProductsController : Controller
246246
public ProductsController(IUmbracoMapper mapper) => _mapper = mapper;
247247

248248
[HttpGet("getall")]
249-
public HttpResponseMessage GetAll()
249+
public IActionResult GetAll()
250250
{
251251
var products = FakeServiceCall();
252252
var mapped = _mapper.MapEnumerable<Product, ProductDto>(products);
253253

254-
return Request.CreateResponse(HttpStatusCode.OK, mapped);
254+
return Ok(mapped);
255255
}
256256

257257
[HttpGet("getfirstproduct")]
258-
public HttpResponseMessage GetFirstProduct()
258+
public IActionResult GetFirstProduct()
259259
{
260260
var product = FakeServiceCall().First();
261261
var mapped = _mapper.Map<ProductDto>(product);
262262

263-
return Request.CreateResponse(HttpStatusCode.OK, mapped);
263+
return Ok(mapped);
264264
}
265265

266266
private IEnumerable<Product> FakeServiceCall()

0 commit comments

Comments
 (0)