473,320 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1663
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Allison | last post by:
I am looking to open my MDE Application using the DB files associated with the application I have created. My application is using a non descript three digit extension that is related to the...
7
by: Senna | last post by:
Hi Have a question about DLinq. The example code floating around looks like this: Northwind db = new Northwind(@"C:\...\northwnd.mdf"); var custs = from c in db.Customers where c.City ==...
3
by: Chiranjib | last post by:
I have the following queries/Observations about DLINQ. 1. I could not find any direct way of handling many to many relations. Suppose if User and Role are related by a join table UserRole then I...
0
by: Scott Nonnenberg [MSFT] | last post by:
This is our first official DLinq chat. We're still early in the planning and development stage for this very cool technology, so we can react to your feedback much more easily. Show up and tell us...
0
by: Scott Nonnenberg [MSFT] | last post by:
Show up and talk to members of the DLinq team. What's DLinq, you ask? Well, to understand that you'll need to know what LINQ is - you can start with the blurb below, read more about it here:...
11
by: Andrus | last post by:
I created dynamic extension methods for <= and < SQL comparison operators: public static IQueryable<TLessThanOrEqual<T>(this IQueryable<Tsource, string property, object value); public static...
1
by: Michel Walsh | last post by:
In the same spirit, but more LINQ related, you can also use ExecuteQuery: var query = dataContext.ExecuteQuery<className>( @"SELECT ... WHERE ... AND... OR... "); where className is...
2
by: Andrus | last post by:
I need to pass DLinq query to RDLDEsigner. RDLDesigner does not accept IQueryable<T>. It accepts SQL select statement in plain text format as data source. How to get SELECT statement which...
2
Nepomuk
by: Nepomuk | last post by:
Recently, I found that I had associated a file type to notepad by mistake. This file type (let's just say, it has the extension .xyz) wasn't supposed to be opened by notepad - actually, it wasn't...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.