Skip to content

Commit 7eaf161

Browse files
Update v15
1 parent cd27310 commit 7eaf161

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

15/umbraco-cms/reference/mapping.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,6 @@ The analyzer follows the standard analyzer development patterns, and building th
189189

190190
Below you will find a full example showing you how to map a collection of type Product to a collection of type ProductDto.
191191

192-
{% hint style="warning" %}
193-
The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15.
194-
{% endhint %}
195-
196192
```csharp
197193
#region Models
198194

@@ -241,13 +237,15 @@ public class ProductComposer : IComposer
241237

242238
#endregion
243239

244-
public class ProductsController : UmbracoApiController
240+
[ApiController]
241+
[Route("/umbraco/api/products")]
242+
public class ProductsController : Controller
245243
{
246244
private readonly IUmbracoMapper _mapper;
247245

248246
public ProductsController(IUmbracoMapper mapper) => _mapper = mapper;
249247

250-
[HttpGet]
248+
[HttpGet("getall")]
251249
public HttpResponseMessage GetAll()
252250
{
253251
var products = FakeServiceCall();
@@ -256,7 +254,7 @@ public class ProductsController : UmbracoApiController
256254
return Request.CreateResponse(HttpStatusCode.OK, mapped);
257255
}
258256

259-
[HttpGet]
257+
[HttpGet("getfirstproduct")]
260258
public HttpResponseMessage GetFirstProduct()
261259
{
262260
var product = FakeServiceCall().First();

0 commit comments

Comments
 (0)