Exemple #1
0
        public async Task <IHttpActionResult> GetAll()
        {
            try
            {
                var data = await _dataProcessor.GetAll();

                if (data != null)
                {
                    return(Ok(data));
                }
                else
                {
                    return(NotFound());
                }
            }
            catch (BusinessLayerException ex)
            {
                var errors = default(string);
                foreach (var item in ex.Errors)
                {
                    errors += item;
                }
                return(BadRequest(errors));
            }
        }