Skip to content

Commit e946616

Browse files
Add attributes
1 parent dec9aef commit e946616

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

14/umbraco-cms/implementation/unit-testing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,16 @@ The example below uses UmbracoApiController which is obsolete in Umbraco 14 and
168168
{% endhint %}
169169

170170
```csharp
171+
[ApiController]
172+
[Route("/umbraco/api/products")]
171173
public class ProductsController : UmbracoApiController
172174
{
173175
public IEnumerable<string> GetAllProducts()
174176
{
175177
return new[] { "Table", "Chair", "Desk", "Computer", "Beer fridge" };
176178
}
177179

178-
[HttpGet]
180+
[HttpGet("getallproductsjson")]
179181
public JsonResult GetAllProductsJson()
180182
{
181183
return new JsonResult(this.GetAllProducts());

0 commit comments

Comments
 (0)