var categoryIdArray = MusicCategoryRelationBLL.GetModel(music.Id); music.MusicCategoryIds = string.Empty; //if (categoryIdArray.Count > 0) //{ // foreach (var item in categoryIdArray) // { // music.MusicCategoryIds += "," + item.Id; // } // music.MusicCategoryIds = music.MusicCategoryIds.Substring(1); //} //var result = categoryIdArray.AsEnumerable().Select(n => new { Id = (n.Id).ToString() }).ToArray(); var result = categoryIdArray.AsEnumerable().Select(n => (n.Id).ToString()).ToList();
var result = categoryIdArray.AsEnumerable().Select(n => (n.Id).ToString());
var result = categoryIdArray.Select(n => (n.Id).ToString());
music.MusicCategoryIds = string.Join(",", result);