DocSas/PropertyService.Domain/ModelView/Roles/RoleProvider.cs
/// <summary>
/// get available roles as an asynchronous operation.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
get available roles as an asynchronous operation.
get available roles as an asynchronous operation .
public async Task<DSCResponse> GetAvailableRolesAsync(Guid userId)
        {
            var msg = new Dictionary<string, string>();
            var response = new DSCResponse();
            var management = await _appCommon.GetManagementUserAsync(userId);
            if (management != null)
            {
                var roles = await _availableRoleRepo.GetAsync(x => x.ManagementUserId == management.Id);
                var roleVMs = _mapper.Map<IEnumerable<AvailableRoleVM>>(roles);
                response.ResponseData = roleVMs.OrderBy(x => x.Title).ToList(); ;
            }
            response.ErrorMessage = msg;
            return response;
        }
public async Task < DSCResponse > GetAvailableRolesAsync ( Guid userId ) { var msg = new Dictionary < string , string > ( ) ; var response = new DSCResponse ( ) ; var management = await _appCommon . GetManagementUserAsync ( userId ) ; if ( management != null ) { var roles = await _availableRoleRepo . GetAsync ( x => x . ManagementUserId == management . Id ) ; var roleVMs = _mapper . Map < IEnumerable < AvailableRoleVM > > ( roles ) ; response . ResponseData = roleVMs . OrderBy ( x => x . Title ) . ToList ( ) ; ; } response . ErrorMessage = msg ; return response ; }
get available roles as an asynchronous operation.
get available roles as an asynchronous operation .
None
userId
Guid
The user identifier.
The user identifier .