Search code examples
.netmappervalueinjecter

what does FlatLoop/UnFlatLoop mean in valueinjecter?


here is the valueinjecter doc(http://valueinjecter.codeplex.com/documentation), but i'm not so

clear about these terms, flattening/unflattening ,FlatLoop/UnFlatLoop ... , how could i

understand these easier ?

thanks !


Solution

  • flatloop will do this:

    flat.InjectFrom<FlatLoopValueInjection>(unflat);
    
    //same as doing
    flat.HeythereHowareYou = unflat.Hey.ther.How.are.You
    
    flat.abcde = unflat.abc.d.e
    

    and unflat the other way around

    unflat.InjectFrom<UnflatLoopValueInjection>(flat);
    
    //same as doing
    unflat.very.big.object.nesting = flat.verybigobjectnesting
    
    unflat.a.b.c.d.e = flat.abcde
    

    hope you'll like my way of explaining things :)