File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments