public Label DeleteLabel(Label label) { using (var db = new CardsDb()) { db.Entry(new Label() { ID = label.ID }).State = EntityState.Deleted; db.SaveChanges(); return label; } }
public Label CreateLabel(Label label) { using (var db = new CardsDb()) { label = db.Labels.Add(label); db.SaveChanges(); return label; } }
public static Label Create(string name, string color) { var db = DbFactory.Create(); //contruct label object var label = new Label() { Name = name, Color = color }; label = db.CreateLabel(label); LabelCache.Reset(); return label; }
public Label Post(Label label) { return Label.Create(label.Name, label.Color); }
public Label Delete(Label label) { return Label.Delete(label.Name); }