Ejemplo n.º 1
0
        /// <summary>
        ///    根据DownloadIds数组获取Download信息列表
        /// </summary>
        /// <param name="DownloadIds">主键集合</param>
        /// <returns>Download信息列表</returns>
        public List <DownloadEntity> GetDownloads(Guid[] DownloadIds, bool iscache)
        {
            if (iscache)
            {
                return
                    (MediaCommon.cache_Download.GetFromDB(DownloadIds, new MediaRepository().GetDownloads)
                     .Select(m => m.ConvertToDto())
                     .ToList());
            }
            var d    = new MediaRepository().GetDownloads(DownloadIds);
            var list = new List <DownloadEntity>();

            if (d != null && d.Any())
            {
                foreach (KeyValuePair <Guid, DownloadDO> item in d)
                {
                    list.Add(item.Value.ConvertToDto())
                    ;
                }
            }
            return(list);
        }