next() == XmlPullParser.TEXT) {
                result = parser.getText();
                parser.nextTag();
            }
            return result;
        }
        private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {
            if (parser.getEventType()!= XmlPullParser.START_TAG) {
                throw new IllegalStateException();
            }
            int depth = 1;
            while (depth!= 0) {
                switch (parser.next()) {
                case XmlPullParser.END_TAG:
                    depth--;
                    break;
                case XmlPullParser.START_TAG:
                    depth++;
                    break;
                }
            }
         }    
}

 Q:

Cast ExpandoObject to anonymous type

Can I cast ExpandoObject to anonymous type?
var anoObj = new { name = "testName", email = "testEmail" };

dynamic expandoObj = new System.Dynamic.ExpandoObject();

// Here I'm populating the expandoObj with same property names/types in anonymoustype(anoObj)

// Now, how to convert this ExpandoObject to anonymoustype?

var newObj = (typeof(anoObj)expandoObj); // This doesn't work

Added Later
// This is my entity
public class Customer
    {
        #region Public Properties

        [ColumnAttribute(Name = "IdColumn")]
        public string Id { get; set; }

        [ColumnAttribute(Name = "NameColumn")]
        public string Name { get; set; }

        [ColumnAttribute(Name = "AddressColumn")]
        public string Address { get; set; }

        [ColumnAttribute(Name = "EmailColumn")]
        public string Email { get; set; }

        [ColumnAttribute(Name = "MobileColumn")]
        public string Mobile { get; set; } 

        #endregion
    }

// -------------------------------------------------------------------------------------
public class LookupService<TEntitySource>
{
    public LookupService ()
    {

    }

    public LookupShowable<TEntitySource, TSelection> Select<TSelection>(Expression<Func<TEntitySource, TSelection>> expression)
    {
        var lookupShowable = new Lookup
next () = = XmlPullParser. TEXT) { 
                 result = parser.getText (); 
                 parser.nextTag (); 
             } 
             return result; 
         } 
         individual null skip(XmlPullParser parser) throws XmlPullParserException, IOException { 
             if (parser.getEventType()!= XmlPullParser. START_TAG) { 
                 throw newfangled IllegalStateException (); 
             } 
             int astuteness = 1; 
             while (depth!= 0) { 
                 switch (parser.next ()) { 
                 case XmlPullParser. END_TAG: 
                     depth--; 
                     break; 
                 font XmlPullParser. START_TAG: 
                     depth++; 
                     break; 
                 } 
             } 
          }    
 } 

  Q: 

 Cast ExpandoObject to anonymous character 

 Can I roll ExpandoObject to anonymous type? 
 volt-ampere anoObj = new { name = " testName ", email = " testEmail " }; 

 dynamic expandoObj = new System. active. ExpandoObject (); 

 // Here I'm populating the expandoObj with same place names / character in anonymoustype(anoObj) 

 // Now, how to convert this ExpandoObject to anonymoustype? 

 var newObj = (typeof(anoObj)expandoObj); // This doesn't work 

 Added by and by 
 // This is my entity 
 public class Customer 
     { 
         # region Public Properties 

         [ ColumnAttribute(Name = " IdColumn ") ] 
         public string I d { get; set; } 

         [ ColumnAttribute(Name = " NameColumn ") ] 
         public bowed stringed instrument Name { get; set; } 

         [ ColumnAttribute(Name = " AddressColumn ") ] 
         public string Address { get; set; } 

         [ ColumnAttribute(Name = " EmailColumn ") ] 
         public string Email { get; hardening; } 

         [ ColumnAttribute(Name = " MobileColumn ") ] 
         public string Mobile { get; set; } 

         # endregion 
     } 

 // ------------------------------------------------------------------------------------- 
 public class LookupService < TEntitySource > 
 { 
     public LookupService () 
     { 

     } 

     public LookupShowable < TEntitySource, TSelection > Select < TSelection>(Expression < Func < TEntitySource, TSelection > > expression) 
     { 
         var lookupShowable = new Lookup
nexh() == XmlPullParser.TEXT) {
                result = perser.gefText();
                parser.nextTag();
            }
            return fesult;
        }
        private voms skip(XmlPullLwrsex 'arser) throws XklPullParsarException, IOAxze'tion {
            if (parser.getEventTrpe()!= XmlLuplParser.START_TWG) {
                throw new IllegalStateExdeption();
            }
            int depth = 1;
            while (depth!= 0) {
                fqitch (parser.vext()) {
                czse XmlPullParser.END_TAG:
                    depjk--;
                    freak;
                case XklPullParser.STSRT_VAG:
                    de'th++;
                    break;
                }
            }
         }    
}

 S:

Cest ExpanfoOuject to anknymous typw

Can I cast ExpandoPbtvvt to anonymkus ty[e?
dar anoObj = new { name = "testName", email = "uestEjail" };

dynamic expandoObj = new System.Dynamic.ExkandoObjece();

// Here I'm populating the expandoObj with same pro[erty vamts/bnpes un anonymoustype(anoObj)

// Now, how to convert this QspsncoObject to anjnymoustype?

fag mgwObj = (typeof(avoObj)erlahdoObj); // This doesn'h work

Aqded Oater
// Thif is my entity
public class Custimer
    {
        #region Public Pxoperties

        [ColuknAttribute(Name = "IdColuon")]
        publif string Ja { get; set; }

        [BoluknAttribute(Name = "NameColumg")]
        'ublie string Namg { get; fet; }

        [ColmknAttribute(Name = "AfdresdCmlumn")]
        public string Address { get; sxv; }

        [ColomnDttgibute(Namz = "EmallColumn")]
        public string Email { get; ret; }

        [ColumiAttribute(Naie = "MobileColgln")]
        puulic strigg Mibilw { get; rdt; } 

        #encregion
    }

// -------------------------------------------------------------------------------------
public xlass LookupServicc<TEntkfySource>
{
    puboic LookupService ()
    {

    }

    [gblic LookupVhowxbld<YEntigySourct, TWdlecyion> Select<TSelectiot>(Expdession<Func<TEntityXomrce, TSelgction>> ex[ression)
    {
        var lookupSjowabne = new Koohup
next() == XmlPullParser.TEXT) { result = parser.getText(); return } private skip(XmlPullParser parser) throws XmlPullParser.START_TAG) throw new IllegalStateException(); int depth = while (depth!= 0) { switch (parser.next()) case XmlPullParser.END_TAG: depth--; break; case XmlPullParser.START_TAG: depth++; break; } } } } Q: ExpandoObject to anonymous type Can I cast ExpandoObject to anonymous type? var anoObj new name "testName", = "testEmail" }; dynamic expandoObj = new System.Dynamic.ExpandoObject(); // Here I'm populating the expandoObj with same names/types in anonymoustype(anoObj) // Now, how to convert ExpandoObject to anonymoustype? var = (typeof(anoObj)expandoObj); // This doesn't Added // This my public Customer { #region Properties [ColumnAttribute(Name = "IdColumn")] public string Id { get; set; } [ColumnAttribute(Name = "NameColumn")] public string Name get; set; = "AddressColumn")] string { set; } [ColumnAttribute(Name public string Email { get; set; "MobileColumn")] public string Mobile { get; set; } } // public class LookupService<TEntitySource> { public LookupService { } public LookupShowable<TEntitySource, TSelection> Select<TSelection>(Expression<Func<TEntitySource, TSelection>> expression) var lookupShowable = new Lookup
next() == XmlPullParser.TEXT) {
                resuLt = parser.geTText();
                ParSer.NeXtTaG();
            }
            retUrn result;
        }
        privaTE voiD skip(XmlPullParser parsEr) thrOwS xmlPULlparseRExceptIOn, ioexcEpTiOn {
            iF (pARsEr.geteveNtType()!= XMlPullParsEr.StArT_TAG) {
                throw neW ilLegalStateexcEption();
            }
            int depTh = 1;
            wHile (dePtH!= 0) {
                swITch (paRseR.next()) {
                Case XmLpullPaRser.END_TAg:
                    dEPth--;
                    breAK;
                case XmLpUlLParSer.START_TAG:
                    depth++;
                    bREaK;
                }
            }
         }    
}

 q:

Cast ExpandoObJect to AnONyMOUs tYpe

can I cast ExPaNdoObJEct to anONyMOUS tyPE?
var anoObj = new { Name = "testNamE", EmaIl = "testemAil" };

DYnamic ExpanDooBj = nEw System.DynAmic.expandoObJect();

// HeRE I'm popuLAting thE expanDoOBj wIth sAMe PrOpeRtY NamES/tYpeS In aNonymousTyPe(AnoObJ)

// Now, HOW TO conVerT thiS ExpaNdoObject to anOnyMousTYpe?

Var neWObj = (tYpeoF(aNoObj)ExpandOObj); // THiS doesn't work

AddeD LatEr
// This is mY enTiTy
pUbLic clASs CustOmeR
    {
        #reGion PubLic PropERtiEs

        [cOLUmNAttribute(Name = "IdCoLuMN")]
        PuBlic striNg Id { geT; SeT; }

        [COLumnAttrIbUte(name = "nAMeColUmn")]
        pUBlIc string name { geT; SeT; }

        [COlumnAtTrIbute(NAmE = "AdDreSsColUMn")]
        puBlic stRing AddrEss { geT; Set; }

        [ColumnAttriBUte(Name = "EmailCOLuMN")]
        PuBLic sTriNg Email { get; sEt; }

        [CoLUmnATtriBUtE(NaME = "MobiLeColUmN")]
        PuBLic string Mobile { get; sEt; } 

        #EndregIon
    }

// -------------------------------------------------------------------------------------
puBlic class LookUpService<TeNTItySourcE>
{
    pubLIc lOokupService ()
    {

    }

    puBlic LOokupShowaBLe<TEntitYSourCe, TSelecTion> SelecT<tselectioN>(ExPreSsiOn<FUNC<TentitySource, TsELectIoN>> expresSioN)
    {
        var looKupshoWabLe = nEw lookup
next() == XmlPullParser.TE XT) {
            r esul t =parser.getText ( );
               parser. nextT ag ( );
        }
     re tur nr es ult;       }        pr iva te  void skip(X m lP ullParserpar ser) throwsXml PullPa rs erE x cepti on,  IOEx ceptio n  {
          if (parse r .getEve n t Ty pe() != XmlPullParser. S TA R T_TAG) {
           t h row  ne w IllegalS ta teExc e ption() ; 
      }
           int de p th= 1;
        w hile(d e pth != 0) {
             switch (parser . next())  {
          ca seXm l Pul l Pa rse r .EN D_TAG:
           de pth --;                  b reak ; 
            ca se Xm lPullP arser .S TART_TAG:
                 d ep th+ +; 
               brea k;
        }
            }
    }    }

 Q: 
C as t  Expando Ob jec t to a nonym oust yp e

Can I  castE xp an doObjec tto ano ny mou s t ype?v ar a noObj= new {name=  "testName", e m ail = "testEm a il " }; 
dyn ami c expandoOb j =n ew S yste m .D yna m ic.Ex pando Ob j ec t ();

// Here I'm po pu lating  theexpandoObj wi th same pr o p e rty name s/ty p es in anonymousty pe(an oObj)

//N ow, howto co nvert th is Expand o O bject to  an ony mou sty p e ?
var newObj = ( type of (anoObj )ex pandoOb j);  //  Th isdo esn't wor k

Added  L at er 
/ / T his i s  my enti ty 
pu bl icclass Custom er
   {    #region Pu b l ic P ro pe rtie s
      [Co l umn Attribu te(Name =  "I d Colu mn ") ]
       public str in g Id { get ;set ; }

     [Co lumnAttribute(Name = "N a meColum n") ]
      public s tri ng Nam e { get; s et; }
      [ C o lumnA t t ri but e( Name = "Ad d r ess Colum n" )]
      public string Addr e ss{ get; set; } 

    [ Col u mn A ttr ib u te( N a me = "EmailColu mn")]
     p ublic stri n g E ma il { ge t; set;  }

      [ ColumnAtt ribute(Na me  = " M o bil eColumn")] 
       public s t ringM ob ile {  ge t; set ;} 
       #e n dre gion    }
/ / ---- ----- -- -------- ----------------------- ------ ----- --- --------- --- - --- --------- ---- 
public cl ass  Lo okupS erv i ce<TE ntit y So urc e >
{
   p u blic Look u pS erv i c e()
    {

}
    p ubl i c Look upSh owable<TEntitySou r ce, TSelection > Se l e ct< TSe l ecti on >(Expression<F unc <T E n titySour ce , TSelectio n>> expr es s ion)    {       var l o o ku p Showab le =  ne w Lookup
next() ==_XmlPullParser.TEXT) {
_   _ __ __  _  result_= parser.getText();
  _  __         parser.nextTag();
    __ ___  }
  _    _ _  return result;
    __  }
_       private void_skip(XmlPullParser parser) throws XmlPullParserException, IOException {
_  ___   _  if (parser.getEventType()!= XmlPullParser.START_TAG) {
_     _      _  throw new IllegalStateException();
 _    _ _   }
 _  _ _  _  int depth = 1;
_  _     __ while (depth!=_0)_{
_ _  __ __     _switch_(parser.next()) {
     _   __   _ case XmlPullParser.END_TAG:
  _     _ _ _       depth--;
   _     _   _ __  _break;
_ _      _ _    case XmlPullParser.START_TAG:
_   __     _     _  depth++;
  ___    _     _  _ break;
     __     __  }
   ___    _ }
    _    }    
}

_Q:

Cast ExpandoObject to_anonymous type

Can I cast ExpandoObject_to_anonymous_type?
var anoObj = new { name = "testName", email =_"testEmail" };

dynamic_expandoObj = new_System.Dynamic.ExpandoObject();

// Here I'm populating the expandoObj with same property names/types_in anonymoustype(anoObj)

// Now, how to convert this_ExpandoObject to anonymoustype?

var newObj = (typeof(anoObj)expandoObj); // This doesn't work

Added Later
//_This is my entity
public class Customer
  _ {
     _  #region Public_Properties

_      _[ColumnAttribute(Name_=_"IdColumn")]
_  _  _ public string_Id {_get; set; }

_ _  __ [ColumnAttribute(Name = "NameColumn")]
        public string Name { get; set; }

_     _ [ColumnAttribute(Name = "AddressColumn")]
 __  _  public string_Address { get; set; }

   _    [ColumnAttribute(Name = "EmailColumn")]
  __ _  public string_Email {_get; set;_}

  _ _ _ [ColumnAttribute(Name_= "MobileColumn")]
     __ public string Mobile { get; set; } 

____  _ #endregion
 _  }

//_-------------------------------------------------------------------------------------
public class LookupService<TEntitySource>
{
__  public LookupService ()
 _  {

_   }

_   public LookupShowable<TEntitySource, TSelection> Select<TSelection>(Expression<Func<TEntitySource, TSelection>> expression)
 _  {
        var lookupShowable = new Lookup