Update CreateAsync to return DataResult<TReadDto>

Modified the CreateAsync method in CRUDService.cs and ICRUDService.cs to change the return type from DataResult<TId> to DataResult<TReadDto>. The implementation now maps the created entity to a read DTO, providing the caller with the complete entity representation instead of just its ID.
This commit is contained in:
Developer 02
2025-05-20 12:44:43 +02:00
parent b95baaef5f
commit d49aaf61dc
2 changed files with 4 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ namespace DigitalData.Core.Application.Interfaces
/// </summary>
/// <param name="createDto">The data transfer object containing the information for the new entity.</param>
/// <returns>A task representing the asynchronous operation, with a <see cref="DataResult{TId}"/> containing the identifier of the created entity or an error message.</returns>
Task<DataResult<TId>> CreateAsync(TCreateDto createDto);
Task<DataResult<TReadDto>> CreateAsync(TCreateDto createDto);
/// <summary>
/// Updates an existing entity based on the provided updateDTO and returns the result wrapped in an IServiceMessage,