private string GetId(IMappedObject obj) { if (obj == null) { throw new ArgumentNullException("obj"); } string id = obj.RemoteObjectId; if (id == null) { throw new ArgumentException("The given object has no remote object id", "obj"); } return id; }