internal static void SaveApi(Api api) { connection.Execute("DELETE FROM [API] WHERE [key] = @key", new { key = api.Key }); connection.Execute("INSERT INTO [API] ([key], [parameters]) VALUES (@key, @parameters);", new { key = api.Key, parameters = api.Parameters }); }
public ActionResult Add(Api api) { ApiHelper.SaveApi(api); return RedirectToAction("Index"); }