471,334 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,334 software developers and data experts.

Re: Associations in DLinq Select() extension method

How to fix ?

Write it the way that you know works... (i.e. the one you commented
out), or write that parses the input string doing a Split on '.', and
uses reflection to navigate the child hierarchy. Which isn't something I
have time to do right now...

Marc
Jun 27 '08 #1
9 1589
Marc,
Write it the way that you know works... (i.e. the one you commented out),
Columns can be specified by user at runtime. So I cannot hard-code them into
code.
I can try to create separate assembly containing this query at runtime and
compile it dynamically.
Is this reasonable ?
or write that parses the input string doing a Split on '.', and uses
reflection to navigate the child hierarchy. Which isn't something I have
time to do right now...
I'm unable to implement it using reflection: I do'nt have enough deep
knowledge about expression tree.

Where to find GetProperty() method which accepts dotted notation and
traveres through object tree ?
Such method should be very useful in may cases. Is this present in .NET
framework ?
Is it possible to use MS Dynamic Linq Library Expression
evaluator for this ?

Andrus.
Jun 27 '08 #2
I'm unable to implement it using reflection: I do'nt have enough deep
knowledge about expression tree
Depending on your urgency, I might be able to look at this, but it won't
be "now"...
Where to find GetProperty() method which accepts dotted notation and
traveres through object tree ?
Such method should be very useful in may cases. Is this present in .NET
framework ?
Well, the binding code does something like this, but not in a way that
would be easy to use...
Is it possible to use MS Dynamic Linq Library Expression
evaluator for this ?
I have no idea.
Jun 27 '08 #3
Marc,
>I'm unable to implement it using reflection: I do'nt have enough deep
knowledge about expression tree
Depending on your urgency, I might be able to look at this, but it won't
be "now"...
If you have some time in future it would be very useful.
Maybe it would be useful to add this function to MiscUtil library.

Andrus.
Jun 27 '08 #4
On Apr 28, 12:21 pm, "Andrus" <kobrule...@hot.eewrote:
I'm unable to implement it using reflection: I do'nt have enough deep
knowledge about expression tree
Depending on your urgency, I might be able to look at this, but it won't
be "now"...

If you have some time in future it would be very useful.
Maybe it would be useful to add this function to MiscUtil library.
I don't think so. I see this as part of what the LINQ provider should
be doing for you. Again, it looks like DLinq isn't really ready for
everything you want it to do.

Jon
Jun 27 '08 #5
I don't think so.

I strongly agree; this is not a MiscUtil thing - and besides, Jon owns
that, not me - I just happened to contribute a small part...

But the fact remains, you seem to have a rather unique take on what LINQ
should do... and if it can't do it, you try to do it anyway (or you try
to get others?me? to)... from a support perspective, that is never a
good idea.

Marc
Jun 27 '08 #6
OK; I've had a few moments to think, and I've reached un unavoidable
conclusion. From "day dot", people (myself and many others) have
repeatedly told you that your design works in an unorhadox manner, that
wasn't really directly suited to LINQ. And warned that at each stage you
were going to hit problems.

Well, sure enough; at each stage, you've hit problems; and perhaps
foolishly I've assisted with each successive issue because *considered
individually* it was only a small problem, that could be worked around.

Well; putting a while series of little problems one after the other is
just an endless cycle.

I don't mean to be obstructive, but I have to draw the line eventually;
I'm not simply here to unpick this one system, and there are better
things (for myself, my company, and the community) that I could do with
my time.

So: sorry, but I won't be looking at "supporting dots" in property
lookups. I hope you understand; it isn't personal.

But any more general C# / .NET etc questions, and I'm all ears.

Marc
Jun 27 '08 #7
Jon,
I don't think so. I see this as part of what the LINQ provider should
be doing for you.
LINQ provider should consume expression trees, not to create it.
So I still think this should be task of dynamic generic linq library which
can
then used with any provider.

MS Dynamic Linq Library return non-generic IQueryable.

We need dynamic linq library which returns generic IQueryable<TAnonymuous>
types like compiler generated code does for anonymuous types statically.
Again, it looks like DLinq isn't really ready for
everything you want it to do.
DLinq ( = DataBase LINQ) is used as common denominator to refer all linq
providers which allow to retrieve database data.
I have seen such usage in MS blogs.

If we need to refer to specific provider, we can use this provider name like
DbLinq, Ling-SQL
etc.

Andrus.

Jun 27 '08 #8
DLinq ( = DataBase LINQ) is used as common denominator to refer all linq
providers which allow to retrieve database data.
When I see DLinq, I read "LINQ to SQL"; which is why it sometimes get
especially confusing when talking about DLinq (one of the MS
offerings) and DbLinq (one of the alternatives).

By the way, MS are apparently investigating the "connect" issue with
the cache. I'll keep you posted of any updates.

Marc
Jun 27 '08 #9
Andrus <ko********@hot.eewrote:
I don't think so. I see this as part of what the LINQ provider should
be doing for you.

LINQ provider should consume expression trees, not to create it.
But the C# compiler is already creating an expression tree, isn't it?
Maybe I've missed something about what you're trying to do in the first
place...
So I still think this should be task of dynamic generic linq library which
can then used with any provider.

MS Dynamic Linq Library return non-generic IQueryable.

We need dynamic linq library which returns generic IQueryable<TAnonymuous>
types like compiler generated code does for anonymuous types statically.
Again, it looks like DLinq isn't really ready for
everything you want it to do.

DLinq ( = DataBase LINQ) is used as common denominator to refer all linq
providers which allow to retrieve database data.
Not in my experience. I understand DLinq as another name for LINQ to
SQL - although I misread the subject of your post as DbLinq rather than
DLinq, which doesn't help things.
I have seen such usage in MS blogs.

If we need to refer to specific provider, we can use this provider name like
DbLinq, Ling-SQL
etc.
And does LINQ to SQL not handle this case?

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Senna | last post: by
3 posts views Thread by Chiranjib | last post: by
reply views Thread by Scott Nonnenberg [MSFT] | last post: by
reply views Thread by Scott Nonnenberg [MSFT] | last post: by
1 post views Thread by Michel Walsh | last post: by
2 posts views Thread by Andrus | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.