private void AddTaskToFirebase(ToDo task) { //client = new FireSharp.FirebaseClient(config); //var data = task; //PushResponse response = client.Push("Tasks/", data); //data.task_id = response.Result.name; //SetResponse setResponse = client.Set("Tasks/" + data.task_id, data); }
public ActionResult Create(ToDo task) { try { AddTaskToFirebase(task); ModelState.AddModelError(string.Empty, "Added Successfully"); } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); } return(View()); }