Ejemplo n.º 1
0
        public ActionResult Post(string tablename, [FromBody] object value)
        {
            ActionResult result = null;

            try
            {
                JArray array = (JArray)value;

                SQLConnector connector = new SQLConnector(_connectionString);

                foreach (JObject jObject in array.Children())
                {
                    Dictionary <string, string> updateSet = GetValues(jObject);

                    connector.InsertSingleRecord(tablename, updateSet);
                }



                result = NoContent();
            }
            catch (Exception ex)
            {
                result = StatusCode(500, new { Error = ex.Message });
            }

            return(result);
        }