refactor(DigitalData.Core.API): Aktualisiert für aktuelle Application und Application.Abstraction
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DigitalData.Core.Application.DTO;
|
||||
using DigitalData.Core.Application.Abstraction;
|
||||
using DigitalData.Core.Application.Abstraction.DTO;
|
||||
|
||||
namespace DigitalData.Core.API
|
||||
{
|
||||
@@ -49,10 +49,10 @@ namespace DigitalData.Core.API
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _service.CreateAsync(createDto).ThenAsync<TId, IActionResult>(
|
||||
Success: id =>
|
||||
return await _service.CreateAsync(createDto).ThenAsync<TReadDto, IActionResult>(
|
||||
Success: dto =>
|
||||
{
|
||||
var createdResource = new { Id = id };
|
||||
var createdResource = new { Id = dto.GetId() };
|
||||
var actionName = nameof(GetById);
|
||||
var routeValues = new { id = createdResource.Id };
|
||||
return CreatedAtAction(actionName, routeValues, createdResource);
|
||||
|
||||
Reference in New Issue
Block a user