Exemple #1
0
        public async Task <User> SetAdminRoleAsync(int userId)
        {
            var user = await userReadRepository.GetByIdAsync(userId);

            var adminRole = await roleReadRepository.GetAdminRoleAsync();

            user.RoleId = adminRole.Id;

            await userWriteRepository.UpdateAsync(user);

            return(user);
        }
        public async Task<Role> GetAdminRoleAsync()
        {
            var result = await roleReadRepository.GetAdminRoleAsync();

            return result;
        }