static public Point GetPoint(int Pointid) { Point Pointtemp = null; using (PointRepository Pointrepo = new PointRepository()) { Pointtemp = Pointrepo.GetSingle(Pointid); Pointrepo.context.Entry(Pointtemp).State = EntityState.Detached; } return(Pointtemp); }