Result und DataResult Callbacks wurden zu Controllern hinzugefügt.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using DigitalData.Core.API;
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.UserManager.Application.Contracts;
|
||||
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
||||
using DigitalData.UserManager.Domain.Entities;
|
||||
@@ -19,13 +20,11 @@ namespace DigitalData.UserManager.API.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await _service.DeleteAsyncByGroupUserId(groupId, userId);
|
||||
if (result.IsSuccess)
|
||||
return await _service.DeleteAsyncByGroupUserId(groupId, userId).ThenAsync(Ok, IActionResult (m, n) =>
|
||||
{
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
return BadRequest(result);
|
||||
_logger.LogNotice(n);
|
||||
return BadRequest();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -42,13 +41,11 @@ namespace DigitalData.UserManager.API.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await _service.ReadAllAsyncWith(withUser, withGroup);
|
||||
if (result.IsSuccess)
|
||||
return await _service.ReadAllAsyncWith(withUser, withGroup).ThenAsync(Ok, IActionResult (m, n) =>
|
||||
{
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
return NotFound(result);
|
||||
_logger.LogNotice(n);
|
||||
return NotFound();
|
||||
});
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user