コード例 #1
0
        public async Task <ActionResult <Hero> > Edit(int id, [FromBody] Hero editData)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                editData.Id        = id;
                editData.Creator   = userInfo;
                editData.creatorId = userInfo.Id;
                return(Ok(_service.Edit(editData, userInfo.Id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }