public void AddLabel(AddLabelBindingModel label) { Label labelEntity = new Label(); labelEntity.Text = label.Text; this.Context.Labels.Add(labelEntity); this.Context.SaveChanges(); }
public ActionResult Create([Bind(Include = "Text")] AddLabelBindingModel label) { if (ModelState.IsValid) { this.service.AddLabel(label); return(RedirectToAction("Index")); } return(View()); }