DocSas/PropertyService.Domain/ModelView/Staffs/StaffProvider.cs
/// <summary>
/// delete staff role as an asynchronous operation.
/// </summary>
/// <param name="staffRoleId">The staff role identifier.</param>
/// <param name="userId">The user identifier.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
delete staff role as an asynchronous operation.
delete staff role as an asynchronous operation .
public async Task<DSCResponse> DeleteStaffRoleAsync(Guid staffRoleId, Guid userId)
        {
            var response = new DSCResponse();
            var issuccess = false;
            var management = await _appCommon.GetManagementUserAsync(userId);
            if (management != null)
            {              
                    var staffRole = await _staffRoleRepo.GetSingleAsync(x => x.Id == staffRoleId);
                    if (staffRole != null)
                    {                     
                        issuccess = await _staffRoleRepo.DeleteAsync(staffRole);
                    }
            }
            response.ResponseData = issuccess;
            return response;
        }
public async Task < DSCResponse > DeleteStaffRoleAsync ( Guid staffRoleId , Guid userId ) { var response = new DSCResponse ( ) ; var issuccess = false ; var management = await _appCommon . GetManagementUserAsync ( userId ) ; if ( management != null ) { var staffRole = await _staffRoleRepo . GetSingleAsync ( x => x . Id == staffRoleId ) ; if ( staffRole != null ) { issuccess = await _staffRoleRepo . DeleteAsync ( staffRole ) ; } } response . ResponseData = issuccess ; return response ; }
delete staff role as an asynchronous operation.
delete staff role as an asynchronous operation .
None
staffRoleId
Guid
The staff role identifier.
The staff role identifier .
userId
Guid
The user identifier.
The user identifier .