Created
October 30, 2018 18:12
-
-
Save wellingtonjhn/621adfa4f79034d71c2c7f19051d87da to your computer and use it in GitHub Desktop.
Controller without any try...catch statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Route("api/[controller]")] | |
| [ApiController] | |
| public class ValuesController : ControllerBase | |
| { | |
| private readonly FakeData _data; | |
| public ValuesController(FakeData data) | |
| { | |
| _data = data; | |
| } | |
| [HttpGet] | |
| public ActionResult<int> Get() | |
| { | |
| return _data.GetRandomNumber(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment