public HttpResponseMessage UpdateAvatar(AvatarUpdateRequest model)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            string userId = _userService.GetCurrentUserId();

            _userService.UpdateAvatar(model, userId);

            SuccessResponse response = new SuccessResponse();

            return Request.CreateResponse(HttpStatusCode.OK, response);
        }
Exemplo n.º 2
0
        public void UpdateAvatar(AvatarUpdateRequest model, string userId)
        {
            DataProvider.ExecuteNonQuery(GetConnection, "dbo.Users_UpdateAvatar"
               , inputParamMapper: delegate (SqlParameterCollection paramCollection)
               {
                   paramCollection.AddWithValue("@Avatar", model.Avatar);
                   paramCollection.AddWithValue("@UserId", userId);
               }

               , returnParameters: delegate (SqlParameterCollection param)
               {
               }
               );
        }