示例#1
0
        public IHttpActionResult Post([FromBody] Drink drink)
        {
            var d = DrinkService.Create(drink);

            if (d > 0)
            {
                return(Created("", drink));
            }
            else
            {
                return(NotFound());
            }
        }
示例#2
0
        public async Task <IActionResult> Create([FromBody] DrinkForListDto drink)
        {
            var result = await _drinkService.Create(drink);

            return(new OkObjectResult(ApiResponse.Create(result)));
        }