private static async Task <bool> CheckGroupPlaylistIdentifierExistsForGroupAsync( string groupPlaylistIdentifier, Guid userId, IGroupPlaylistRepository groupPlaylistRepository) { var groupPlaylist = await groupPlaylistRepository.CheckExistsByIdentifierAndGroupIdAsync(groupPlaylistIdentifier, userId); return(groupPlaylist != null); }
private static async Task <string> GenerateNewGroupPlaylistIdentifierAsync( Guid groupId, IGroupPlaylistRepository groupPlaylistRepository) { var newGroupPlaylistIdentifier = ModelHelpers.GenerateUniqueIdentifier(IdentifierConsts.GroupIdentifierLength); var groupPlaylistIdentifierExistsForGroup = await CheckGroupPlaylistIdentifierExistsForGroupAsync( newGroupPlaylistIdentifier, groupId, groupPlaylistRepository).ConfigureAwait(false); if (groupPlaylistIdentifierExistsForGroup) { return(await GenerateNewGroupPlaylistIdentifierAsync(groupId, groupPlaylistRepository).ConfigureAwait(false)); } else { return(newGroupPlaylistIdentifier); } }