refactor(DigitalData.Core.API): Aktualisiert für aktuelle Application und Application.Abstraction
This commit is contained in:
parent
b6212fec55
commit
90db7a356a
@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.Application.Abstraction;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DigitalData.Core.API
|
||||
|
||||
@ -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
|
||||
{
|
||||
@ -46,10 +46,10 @@ namespace DigitalData.Core.API
|
||||
[HttpPost]
|
||||
public virtual async Task<IActionResult> Create(TCreateDto createDto)
|
||||
{
|
||||
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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.Application.DTO;
|
||||
using DigitalData.Core.Application.Abstraction.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text;
|
||||
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using DigitalData.Core.Application.DTO;
|
||||
using DigitalData.Core.Application.Interfaces;
|
||||
using DigitalData.Core.Application.Abstraction;
|
||||
using DigitalData.Core.Application.Abstraction.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DigitalData.Core.API
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user