Exemplo n.º 1
0
        public void Search_Ok_Test()
        {
            var orgInDb = _context.Organizers.First();
            var result  = _organizerOperations.SearchAsync(null, orgInDb.Name.Substring(2)).Result;

            Assert.IsTrue(result.Any());
        }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> Search(int?cityId = null, String word = "", int page = 1)
        {
            try
            {
                var orgs = await _organizerOperations.SearchAsync(cityId, word, page);

                var result = Mapper.Map <List <OrganizerViewModelGet> >(orgs);
                return(Ok(result));
            }
            catch (Exception ex)
            {
                ErrorLogger.Log("CANNOT SEARCH ORGANIZERS", ex);
                throw;
            }
        }