示例#1
0
        public async Task <ActionResult <InstrumentModel[]> > GetByType(string type)
        {
            try
            {
                var result = await _repository.GetInstrumentsByTypeAsync(type);

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

                return(_mapper.Map <InstrumentModel[]>(result));
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }
        }