/// <summary> /// Adds the media to album. /// </summary> /// <param name="batch">The batch.</param> /// <param name="mediaId">The media id.</param> private void AddMediaToAlbum(UploadBatch batch, int mediaId) { if (!string.IsNullOrEmpty(batch.Albums)) { string[] ids = batch.Albums.Split(','); foreach (string id in ids.Where(id => !string.IsNullOrEmpty(id))) { _albumRepository.AddPhotoToAlbum(Convert.ToInt32(id), mediaId); } } }