All online info states to make changes to web.config file, but, as I understand, web.config file doesn't exist in the newer versions of .net mvc. What to do to allow httpDelete method then?
(I've created delete method in my controller that calls MySQL 'delete from table' method)
code:
[HttpDelete]
public ActionResult Delete() //string id
{
connectionString();
conn.Open();
com.Connection = conn;
var userId = HttpContext.Session.GetString("userId");
var stm = "Delete from lex_reminders where reminder_id=@id"; //" + id + ";
var cmd = new MySqlCommand(stm, conn);
cmd.Parameters.AddWithValue("@id", 25);
int res = cmd.ExecuteNonQuery();
if (res>0)
{
conn.Close();
Create(userId);
return View("Create");
}
else
{
conn.Close();
return View("Error");
}
}