Skip to content

IdentityService should only return Generic Types #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pbros opened this issue Feb 8, 2019 · 3 comments
Closed

IdentityService should only return Generic Types #162

pbros opened this issue Feb 8, 2019 · 3 comments
Assignees
Labels
task Task

Comments

@pbros
Copy link
Contributor

pbros commented Feb 8, 2019

The IdentityService uses Generic Types for most of it's methods, but not for the "plural" calls, which prevents from using our own DTO types without re-implementing the service or extending it.

For example, the 2 following methods should return Task<TUsersDto<TUserDto, TUserDtoKey>> and Task<TRolesDto<TRoleDto, TRoleDtoKey>> respectively

        public async Task<UsersDto<TUserDto, TUserDtoKey>> GetUsersAsync(string search, int page = 1, int pageSize = 10)
        {
            var pagedList = await _identityRepository.GetUsersAsync(search, page, pageSize);
            var usersDto = _mapper.Map<UsersDto<TUserDto, TUserDtoKey>>(pagedList);

            return usersDto;
        }

        public async Task<RolesDto<TRoleDto, TRoleDtoKey>> GetRolesAsync(string search, int page = 1, int pageSize = 10)
        {
            PagedList<TRole> pagedList = await _identityRepository.GetRolesAsync(search, page, pageSize);
            var rolesDto = _mapper.Map<RolesDto<TRoleDto, TRoleDtoKey>>(pagedList);

            return rolesDto;
        }
@skoruba
Copy link
Owner

skoruba commented Feb 8, 2019

@pbros - Good point, I will change it. 👍
Thank you!

@skoruba
Copy link
Owner

skoruba commented Feb 15, 2019

Done on dev branch.
Thank you @pbros

@skoruba skoruba mentioned this issue Apr 4, 2019
@skoruba
Copy link
Owner

skoruba commented Apr 4, 2019

Done on master. Please check new release.
Thanks!

@skoruba skoruba closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Task
Projects
None yet
Development

No branches or pull requests

2 participants