I use yield return Row.From(obj); and var obj = row.To<obType> to get
strong typed representations of the row if working with lots of
columns.

Another trick I use sometimes is something like this to keep it
untyped but allow for column renames, etc. without needing to find
magic strings:

        public static string PropertyName<CLASS, T>
(Expression<Func<CLASS, T>> expression)
        {
            MemberExpression body = (MemberExpression)expression.Body;
            return body.Member.Name;
        }

row[myRow.PropertyName(x => x.Column1)] which translates to row
["Column1"] but a refactor/rename will catch it which is nice.

On Jun 30, 3:28 am, Lee Henson <[email protected]> wrote:
> Unless I have misunderstood you, check out the DictionaryAdapter  
> component in Castle. It gives you a strongly-typed interface to  
> dictionaries.
>
> On 29 Jun 2009, at 16:51, zvolkov <[email protected]> wrote:
>
>
>
>
>
> > Having used Rhino ETL for 6+ months now, the only major complain I
> > have is its weakly typed Rows. In my ETL system, I often need to
> > define new operations that take the same type again and again in and
> > spit it out, while doing modifications to the values of its
> > properties.
>
> > It's not just the aesthetics of "Magic Strings" (I'm ok with those as
> > long as they're unit-tested), but it is still quite painful to have to
> > remember the names of the attributes, vs. having IntelliSense suggest
> > them as I type the dot. At first I used Rows.FromObject / ToObject to
> > convert between the dictionary and my hard object representations but
> > that not only is pretty slow but also has some nasty side-effects
> > (default implementation of From/To Object traverses both public _and_
> > private properties).
>
> > It would be nice to have a way to define strongly typed operations.
> > Maybe something along the lines of Microsoft CCR ports... Maybe
> > something else...
>
> > I realize this is an open source project so the best would be to
> > propose my solution, I just don't feel I have one ready yet, that's
> > why I'm bringing up this point for discussion.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to