コード例 #1
0
        public ActionResult <ShoppingList> CreateShoppingList([FromBody] ShoppingListRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var shoppingList = new ShoppingList
            {
                Id   = Guid.NewGuid(),
                Name = request.Name
            };

            return(_service.AddList(shoppingList));
        }