Example #1
0
        public IActionResult Doubling([FromQuery] int?input)
        {
            if (input is null)
            {
                return(Json(new { error = "Please provide an input!" }));
            }
            else
            {
                database.Create(new Logger {
                    CreatedAt = DateTime.Now,
                    Endpoint  = "doubling",
                    Data      = $"input={input}"
                });

                return(Json(new {
                    received = input,
                    result = input * 2
                }));
            }
        }