public void deleteMem(Guid pid) { var mems = _ecdal.GetEntities(m => m.PID == pid); XiaoYan xy = null; foreach (var mem in mems) { xy = mem; } var pers = _persondal.GetEntities(m => m.PID == pid); Person ps = null; foreach (var per in pers) { ps = per; } var accs = _account.GetEntities(m => m.Username == ps.Username); Account at = null; foreach (var acc in accs) { at = acc; } if (xy != null) { _memdal.Delete(xy); _persondal.Delete(ps); _account.Delete(at); } }