/// <summary>
        /// Find by ID
        /// </summary>
        /// <returns></returns>

        IEntityInstanceEnumerator FindStuff()
        {
            IEnumerator    it = _entityInst.GetMethodInstances().Keys.GetEnumerator();
            MethodInstance m  = null;

            while (it.MoveNext())
            {
                String key = (String)it.Current;
                m = (MethodInstance)_entityInst.GetMethodInstances()[key];
                {
                    String b = m.MethodInstanceType.ToString();
                    if (b.Equals("IdEnumerator"))
                    {
                        break;
                    }
                }
            }
            IEntityInstanceEnumerator itt = (IEntityInstanceEnumerator )_entityInst.Execute(m, _lobInst);

            while (itt.MoveNext())
            {
                IEntityInstance e   = (IEntityInstance)itt.Current;
                DataRow         row = e.EntityAsDataRow(e.EntityAsDataTable);
                Object          ob  = row[0];
                IEntityInstance ent = _entityInst.FindSpecific(ob, _lobInst);
                FormatRecord(ent);
            }

            return(itt);
        }
        public IEntityInstance GetEntityInstance(BdcView desiredView)
        {
            if (!BdcClientUtilAvailable)
            {
                throw new Exception(this ["BdcNotAvailable"]);
            }
            if ((desiredView != null) && !string.Equals(desiredView.Name, GetView(entity).Name))
            {
                throw new NotSupportedException();
            }
            if (entityInstance == null)
#if SP12
            { entityInstance = entity.FindSpecific(IdentifierValues, systemInstance); }
#else
            { if (Identity != null)
              {
                  try {
                      entityInstance = entity.FindSpecific(identity, systemInstance);
                  } catch (InvalidOperationException ex) {
                      object [] arr;
                      string    s;
                      Guid      guid;
                      if ((ex.Source == "Microsoft.SharePoint") && ex.Message.Contains("'System.Guid'") && ex.Message.Contains("'System.String'") && ((arr = IdentifierValues) != null) && (arr.Length > 0) && (!string.IsNullOrEmpty(s = arr [0] as string)) && !Guid.Empty.Equals(guid = ProductPage.GetGuid(s)))
                      {
                          arr [0]        = guid;
                          identity       = new Identity(arr);
                          entityInstance = entity.FindSpecific(identity, systemInstance);
                      }
                      else
                      {
                          throw;
                      }
                  }
              }
            }
#endif
            return(entityInstance);
        }