コード例 #1
0
        public async Task <ActionResult> GetAll([FromServices] ITreinoService service)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                return(Ok(await _service.GetAll()));
            }
            catch (ArgumentException e)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
            }
        }
コード例 #2
0
 public TreinoController(ITreinoService service)
 {
     _service = service;
 }