public static PERSPECTIVE_TARGET UpdateTarget(PSsqmEntities ctx, PERSPECTIVE_TARGET target, string updateBy) { PERSPECTIVE_TARGET ret = null; target = (PERSPECTIVE_TARGET)SQMModelMgr.SetObjectTimestamp(target, updateBy, target.EntityState); if (target.EntityState == EntityState.Detached) { ctx.AddToPERSPECTIVE_TARGET(target); } if (ctx.SaveChanges() > 0) { ret = target; } return(ret); }