Example #1
0
        public async void GetAllPracticesTest()
        {
            try
            {
                var practices = await _service.GetAllPractices();

                Assert.NotNull(practices);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Example #2
0
        public async Task <IActionResult> GetAllPractices()
        {
            try
            {
                var practices = await _service.GetAllPractices();

                if (practices == null)
                {
                    return(NotFound());
                }

                return(new ObjectResult(practices));
            }
            catch (Exception ex)
            {
                Log.Error(ex, ex.Message);
                return(BadRequest(ex.Message));
            }
        }