コード例 #1
0
        public IActionResult rateUpdate([FromBody] MvProductRate rate)
        {
            try
            {
                var data = _rateService.UpdateRate(rate);

                return(Ok(data));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #2
0
        public dynamic UpdateRate(MvProductRate rate)
        {
            var json = JsonConvert.SerializeObject(rate);

            using (var sql = _dah.GetConnection())
            {
                using (SqlCommand command = new SqlCommand("SpProductRateUpdJson", sql))
                {
                    command.CommandType = (System.Data.CommandType.StoredProcedure);;
                    command.Parameters.Add(new SqlParameter("@json", json));
                    command.ExecuteNonQuery();
                    return(rate);
                }
            }
        }