473,498 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DLINQ Queries and observations

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 should
be able to have a collection of Roles in User and vice versa. Which i think
is not possible in DLINQ. (Please correct me if I am wrong)

2. State management is handle outside entities. In scenareos where a client
grabs a entity from a WS , makes some changes and post it back to the ws for
updation, how is the DLINQ framework handle optimistic locking?

3. How do I provide optimizer hints in my DLINQ query? I have seen that thw
Query optimize taking wrong desicions white choosing join strategies and I
would like to override it.

4. I always felt the the VS WS proxy generator unnecessarily (re)defined the
custom entities in the generated proxy. I should be able to tell the VS to
use my definitions instead.
Nov 17 '05 #1
3 1691
Chiranjib,

See inline.
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
should
be able to have a collection of Roles in User and vice versa. Which i
think
is not possible in DLINQ. (Please correct me if I am wrong)
That's not possible yet.. At best, the user could have a collection of
roles they are a member of, and the roles have a collection of users they
are a member of.

Remember, this is in it's initial stages. It will be a while before
this is released, so it's possible you will see it down the line (and you
will, if enough people make mention of it).
2. State management is handle outside entities. In scenareos where a
client
grabs a entity from a WS , makes some changes and post it back to the ws
for
updation, how is the DLINQ framework handle optimistic locking?
Over a WS, DLINQ isn't going to be able to do much here. You could use
DLINQ on the server side to return the data, but that's it. When you get it
back to update, you aren't going to be able to plug it back into the DLINQ
framework (at least as it stands now).
3. How do I provide optimizer hints in my DLINQ query? I have seen that
thw
Query optimize taking wrong desicions white choosing join strategies and I
would like to override it.
DLINQ doesn't offer that yet. It might come in the future (overloads of
the various methods), but honestly, I wouldn't hold my breath. If you have
a need for very specialized formation of your queries (which this would seem
to be, and one would ask why you don't use a SP in this case), then
traditional methods are better suited for you.
4. I always felt the the VS WS proxy generator unnecessarily (re)defined
the
custom entities in the generated proxy. I should be able to tell the VS to
use my definitions instead.


Interfaces are a good way to get around this. You can have your types
implement the same interface that you use. I believe that the serialization
story in the Windows Communications Foundation is better, so that you could
use your own type on the client side instead of one generated from WSDL.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
Nov 17 '05 #2
Thanks Nicholas. It was helpful.
Regarding point 4. Interfaces dont help, since VS defines the entities in a
different NS . Hence I have to modify the code generated by the VS proxy
generator.

Painful task :-)

"Nicholas Paldino [.NET/C# MVP]" wrote:
Chiranjib,

See inline.
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
should
be able to have a collection of Roles in User and vice versa. Which i
think
is not possible in DLINQ. (Please correct me if I am wrong)


That's not possible yet.. At best, the user could have a collection of
roles they are a member of, and the roles have a collection of users they
are a member of.

Remember, this is in it's initial stages. It will be a while before
this is released, so it's possible you will see it down the line (and you
will, if enough people make mention of it).
2. State management is handle outside entities. In scenareos where a
client
grabs a entity from a WS , makes some changes and post it back to the ws
for
updation, how is the DLINQ framework handle optimistic locking?


Over a WS, DLINQ isn't going to be able to do much here. You could use
DLINQ on the server side to return the data, but that's it. When you get it
back to update, you aren't going to be able to plug it back into the DLINQ
framework (at least as it stands now).
3. How do I provide optimizer hints in my DLINQ query? I have seen that
thw
Query optimize taking wrong desicions white choosing join strategies and I
would like to override it.


DLINQ doesn't offer that yet. It might come in the future (overloads of
the various methods), but honestly, I wouldn't hold my breath. If you have
a need for very specialized formation of your queries (which this would seem
to be, and one would ask why you don't use a SP in this case), then
traditional methods are better suited for you.
4. I always felt the the VS WS proxy generator unnecessarily (re)defined
the
custom entities in the generated proxy. I should be able to tell the VS to
use my definitions instead.


Interfaces are a good way to get around this. You can have your types
implement the same interface that you use. I believe that the serialization
story in the Windows Communications Foundation is better, so that you could
use your own type on the client side instead of one generated from WSDL.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

Nov 17 '05 #3
Chiranjib,

Interfaces can help here, because you can change the proxy generated by
the client and implement an interface in another namespace. I'm not saying
redefine the interface, use the same one, and it will work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chiranjib" <Ch*******@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
Thanks Nicholas. It was helpful.
Regarding point 4. Interfaces dont help, since VS defines the entities in
a
different NS . Hence I have to modify the code generated by the VS proxy
generator.

Painful task :-)

"Nicholas Paldino [.NET/C# MVP]" wrote:
Chiranjib,

See inline.
> 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
> should
> be able to have a collection of Roles in User and vice versa. Which i
> think
> is not possible in DLINQ. (Please correct me if I am wrong)


That's not possible yet.. At best, the user could have a collection
of
roles they are a member of, and the roles have a collection of users they
are a member of.

Remember, this is in it's initial stages. It will be a while before
this is released, so it's possible you will see it down the line (and you
will, if enough people make mention of it).
> 2. State management is handle outside entities. In scenareos where a
> client
> grabs a entity from a WS , makes some changes and post it back to the
> ws
> for
> updation, how is the DLINQ framework handle optimistic locking?


Over a WS, DLINQ isn't going to be able to do much here. You could
use
DLINQ on the server side to return the data, but that's it. When you get
it
back to update, you aren't going to be able to plug it back into the
DLINQ
framework (at least as it stands now).
> 3. How do I provide optimizer hints in my DLINQ query? I have seen
> that
> thw
> Query optimize taking wrong desicions white choosing join strategies
> and I
> would like to override it.


DLINQ doesn't offer that yet. It might come in the future (overloads
of
the various methods), but honestly, I wouldn't hold my breath. If you
have
a need for very specialized formation of your queries (which this would
seem
to be, and one would ask why you don't use a SP in this case), then
traditional methods are better suited for you.
> 4. I always felt the the VS WS proxy generator unnecessarily
> (re)defined
> the
> custom entities in the generated proxy. I should be able to tell the VS
> to
> use my definitions instead.


Interfaces are a good way to get around this. You can have your
types
implement the same interface that you use. I believe that the
serialization
story in the Windows Communications Foundation is better, so that you
could
use your own type on the client side instead of one generated from WSDL.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1849
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 ==...
0
1205
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
1088
by: Scott Nonnenberg [MSFT] | last post by:
The DLinq team will be ready and waiting for your questions and comments at this date and time at this location: http://msdn.microsoft.com/chats/chatroom.aspx. This is otherwise known as a chat -...
0
1141
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:...
4
1432
by: Brett Romero | last post by:
I've downloaded the DLINQ samples from Microsoft and have always been able to compile these in VS.NET 2005 Pro. I have a new project that I added DLINQ references to and put in a simlpe query. It...
19
1507
by: Andrus | last post by:
I need to repeatedly execute same queries which returns single entity by id, like: Customer cust = (from c in db.Customers where c.CustomerID=="AIRBU" select c).SingleOrDefault(); DLinq...
9
1670
by: Marc Gravell | last post by:
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...
1
2165
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...
0
2438
by: Andrus | last post by:
I implemented cached DLinq ExecuteQuery method. However some queries are run against database always because keys are not found in cache. Maybe equality comparer or other parts of implementation...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7162
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.