Skip to content

Commit e9386f1

Browse files
Update controller
1 parent b5525a6 commit e9386f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

14/umbraco-cms/reference/mapping.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,15 @@ public class ProductComposer : IComposer
241241

242242
#endregion
243243

244-
public class ProductsController : UmbracoApiController
244+
[ApiController]
245+
[Route("/umbraco/api/products")]
246+
public class ProductsController : Controller
245247
{
246248
private readonly IUmbracoMapper _mapper;
247249

248250
public ProductsController(IUmbracoMapper mapper) => _mapper = mapper;
249251

250-
[HttpGet]
252+
[HttpGet("getall")]
251253
public HttpResponseMessage GetAll()
252254
{
253255
var products = FakeServiceCall();
@@ -256,7 +258,7 @@ public class ProductsController : UmbracoApiController
256258
return Request.CreateResponse(HttpStatusCode.OK, mapped);
257259
}
258260

259-
[HttpGet]
261+
[HttpGet("getfirstproduct")]
260262
public HttpResponseMessage GetFirstProduct()
261263
{
262264
var product = FakeServiceCall().First();

0 commit comments

Comments
 (0)