void Save(ShapeModel shape) { using (ShapeDBContext db = new ShapeDBContext()) { db.Shapes.Add(shape); db.SaveChanges(); } }
ShapeModel Last() { ShapeModel shape = new ShapeModel {}; using (ShapeDBContext db = new ShapeDBContext()) { if (db.Shapes.Count() > 0) shape = db.Shapes.ToList().Last<ShapeModel>(); } return shape; }