public async Task <IActionResult> GetStartPage(string slug, string businessId) { return(await _handler.Get(() => { var startPageRepository = _createRepository(_createConfig(businessId)); return startPageRepository.GetStartPage(slug); })); }
public async Task <IActionResult> GetTopicByTopicSlug(string businessId, string topicSlug) { return(await _handler.Get(() => { var topicRepository = _createRepository(_createConfig(businessId)); return topicRepository.GetTopicByTopicSlug(topicSlug); })); }
public async Task <IActionResult> GetEventCategories(string businessId) { return(await _handler.Get(() => { var eventRepository = _eventCategoryRepository(_createConfig(businessId)); return eventRepository.GetEventCategories(); })); }
public async Task <IActionResult> GetArticle(string articleSlug, string businessId) { return(await _handler.Get(() => { var repository = _createRepository(_createConfig(businessId)); var article = repository.GetArticle(articleSlug); return article; })); }
public async Task <IActionResult> GetShowcase(string showcaseSlug, string businessId) { return(await _handler.Get(() => { var repository = _createRepository(_createConfig(businessId)); var showcase = repository.GetShowcases(showcaseSlug); return showcase; })); }
public async Task <IActionResult> GetSection(string sectionSlug, string businessId) { return(await _handler.Get(() => { var repository = _createRepository(_createConfig(businessId)); var section = repository.GetSections(sectionSlug); return section; })); }
public async Task <IActionResult> GetGroups(string businessId) { return(await _handler.Get(() => { var groupRepository = _groupRepository(_createConfig(businessId)); return groupRepository.Get(); })); }
public async Task <IActionResult> Index(string businessId, [FromQuery] string tag = null, [FromQuery] string category = null, [FromQuery] DateTime?dateFrom = null, [FromQuery] DateTime?dateTo = null) { return(await _handler.Get(() => { var repository = _newsRepository(_createConfig(businessId)); return repository.Get(tag, category, dateFrom, dateTo); })); }
public async Task <IActionResult> Index(string letter, string businessId) { return(await _handler.Get(() => { var repository = _createRepository(_createConfig(businessId)); return repository.Get(letter); })); }
public async Task <IActionResult> Detail(string slug, string businessId) { return(await _handler.Get(() => { var contactUsIdRepository = _createRepository(_createConfig(businessId)); return contactUsIdRepository.GetContactUsIds(slug); })); }
public async Task <IActionResult> GetContactUsArea(string contactUsSlug, string businessId) { return(await _handler.Get(() => { var repository = _createRepository(_createConfig(businessId)); var contactUsArea = repository.GetContactUsArea(); return contactUsArea; })); }
public async Task <IActionResult> GetFooter(string businessId) { var response = await _handler.Get(() => { var footerRepository = _createRepository(_createConfig(businessId)); return(footerRepository.GetFooter()); }); return(response); }
public void HandlesException() { var handler = new ResponseHandler(_fakeLogger); var result = AsyncTestHelper.Resolve(handler.Get(() => { throw new Exception("error"); })); Assert.Equal("An unexpected error occurred while performing the get operation", _fakeLogger.ErrorMessage); Assert.Equal(500, (result as StatusCodeResult).StatusCode); }
public async Task <IActionResult> GetAllPrivacyNotices(string businessId) { return(await _handler.Get(async() => { var repository = _privacyNoticeRepository(_createConfig(businessId)); var allPrivacyNotices = await repository.GetAllPrivacyNotices(); if (allPrivacyNotices == null) { return HttpResponse.Failure(System.Net.HttpStatusCode.NotFound, "Privacy notices not found"); } else { return HttpResponse.Successful(allPrivacyNotices); } })); }
public async Task <IActionResult> Get(string businessId) => await _handler.Get(() => _commsRepository(_createConfig(businessId)).Get());
public async Task <IActionResult> GetRedirects() => await _handler.Get(() => _repository.GetRedirects());