Exemple #1
0
        /// <summary>
        /// 获取完整的model信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <DemoMain> GetModelFullAsync(int id)
        {
            if (id < 0)
            {
                return(new DemoMain());
            }

            var entity = await _demoMainRepository.GetModelAsync(id);

            if (entity == null)
            {
                return(new DemoMain());
            }

            //entity.Items = await _demoMainRepository.GetDemoMainItems(id);
            entity.ImageList = await _commonAttachServices.GetAttachListAsync(id, typeof(DemoMain), "ImageList");

            entity.Attachs = await _commonAttachServices.GetAttachListAsync(id, typeof(DemoMain));

            return(entity);
        }
Exemple #2
0
        /// <summary>
        /// 获取完整的model信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <BookInfoView> GetModelFullAsync(int id)
        {
            if (id < 0)
            {
                return(new BookInfoView());
            }

            var entity = await _bookInfoRepository.GetModelViewAsync <BookInfoView>(id);

            if (entity == null)
            {
                return(new BookInfoView());
            }

            entity.Attachs = await _commonAttachServices.GetAttachListAsync(id, typeof(BookInfo));

            return(entity);
        }