Пример #1
0
        public async Task <IHttpActionResult> GetAll()
        {
            try
            {
                IEnumerable <City> cities = await _cityOperations.GetAllAsync();

                var result = Mapper.Map <IEnumerable <CityViewModelGet> >(cities);
                return(Ok(result));
            }
            catch (Exception ex)
            {
                ErrorLogger.Log("CANNOT GETALL CITIES", ex);
                throw;
            }
        }
Пример #2
0
        public void GetAll_Ok_Test()
        {
            var result = _cityOperations.GetAllAsync().Result;

            Assert.IsTrue(result.Any());
        }