public void GetBannerService() { var uow = new UnitOfWork(new DigitalSignageDbContext("TestDigitalSignageTest")); BannerService cS = new BannerService(); Banner Banner = new Banner(); Banner.Name = "nueva campaña"; Banner.Description = "qsy"; Banner.InitDate = new DateTime().AddYears(2018); Banner.EndDate = new DateTime().AddYears(2018); Banner.InitTime = new TimeSpan(); Banner.EndTime = new TimeSpan(); uow.BannerRepository.Add(Banner); uow.Complete(); try { var result = cS.Get(Banner.Id); Assert.IsNotNull(result); } catch (Exception e) { Assert.Fail(e.Message); } }
public BannerDTO Get(int id) { try { var banner = bannerService.Get(id); return(banner); } catch { throw new HttpResponseException(HttpStatusCode.NotFound); } }
public BannerDto Get(int id) { return(_bannerService.Get(id)); }
public ActionResult <List <Banner> > Get() => _bannerService.Get();
public ActionResult <List <Banner> > Get() { return(_bannerService.Get()); }