Example #1
0
        public void Update(ThreadUpdateRequest model)
        {
            string procName = "dbo.Threads_Update_V2";

            _data.ExecuteNonQuery(procName, delegate(SqlParameterCollection parameterCollection)
            {
                parameterCollection.AddWithValue("@Subject", model.Subject);
                parameterCollection.AddWithValue("@Summary", model.Summary);
                parameterCollection.AddWithValue("@Information", model.Information);
                parameterCollection.AddWithValue("@IsActive", model.IsActive);
                parameterCollection.AddWithValue("@Id", model.Id);
            });
        }
        public ActionResult <ItemResponse <int> > Update(ThreadUpdateRequest model)
        {
            int          code     = 200;
            BaseResponse response = null;

            try
            {
                int userId = _authService.GetCurrentUserId();
                _service.Update(model);
                response = new SuccessResponse();
            }
            catch (Exception ex)
            {
                code     = 500;
                response = new ErrorResponse(ex.Message);
            }
            return(StatusCode(code, response));
        }