Skip to content

Commit

Permalink
return OperationResult for further error extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilLord666 committed Feb 21, 2024
1 parent 29e43e1 commit 6cad1c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public interface IResourceBasedReadOnlyService<TRes, TData, TId>
where TRes: class
{
Task<PagedDataDto<TRes>> ReadAsync(int? page, int? size, string sort, string order, IDictionary<string, string> filterParams);
Task<TRes> ReadByIdAsync(TId id);
Task<OperationResultDto<TRes>> ReadByIdAsync(TId id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public virtual async Task<PagedDataDto<TRes>> ReadAsync(int? page, int? size, st
return new PagedDataDto<TRes>(pageNumber, result.Data.Item2, PagingUtils.GetTotalPages(result.Data.Item2, pageSize), result.Data.Item1);
}

public virtual async Task<TRes> ReadByIdAsync(TId id)
public virtual async Task<OperationResultDto<TRes>> ReadByIdAsync(TId id)
{
OperationResultDto<TRes> result = await Manager.GetByIdAsync(id);
return result.Data;
return result;
}

public IModelManager<TRes, TData, TId> Manager { get; set; }
Expand Down

0 comments on commit 6cad1c2

Please sign in to comment.