private List <BannerDetailsModel> GetBannerList() { List <BannerDetailsModel> results = new List <BannerDetailsModel>(); List <BANNER> data = new List <BANNER>(); try { data = DB.BANNER .Where(o => o.DISABLE == false) .OrderByDescending(o => o.BUD_DT).ThenByDescending(g => g.SQ) .ToList(); FileModule fileModule = new FileModule(); using (var bannerModule = new BannerModule()) { foreach (var d in data) { PublicMethodRepository.HtmlDecode(d); BannerDetailsModel temp = bannerModule.DoGetDetailsByID(d.ID); temp.Files = fileModule.GetFiles((int)d.ID, "Banner", "F"); results.Add(temp); } } fileModule.Dispose(); } catch (Exception ex) { throw ex; } return(results); }
public void FileModule_Dispose_WhenNotStarted_DoesNotThrow() { var module = new FileModule(UrlPath.Root, new MockFileProvider()); Assert.DoesNotThrow(() => module.Dispose()); }