public Description ModifyDescription(Description newDescription) { using (var db = new DatabaseContext()) { db.Entry(newDescription).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return (Description)db.Descriptions.Find(newDescription.DescriptionId); } }
public Description CreateDescription(Description description) { using (var db = new DatabaseContext()) { Description CreatedDescription = (Description)db.Descriptions.Add((EntityFramework.Description)description); db.SaveChanges(); return CreatedDescription; } }