FirstOrDefault()

1 view
Skip to first unread message

bryan costanich

unread,
Oct 4, 2008, 5:21:32 PM10/4/08
to DbLinq
Hi all,

I used the DBMetal.exe to create the c# files for my MySQL database,
but i notice that the tables don't support the FirstOrDefault()
method.

I was wondering if there was any plan to put that in any time soon.
For me, it's kind of a pri-0 feature, since i use it everywhere i need
to get a single item from a database (i've found it to actually be one
of the most useful parts of LINQ).

Plans? Thoughts?

Pascal Craponne

unread,
Oct 5, 2008, 4:02:57 PM10/5/08
to dbl...@googlegroups.com
Some methods are already supported this way (when they're given an argument), so we can expand their behavior to FirstOrDefault() handling. Bryan, this could be a good way to enter the project :)
--
Pascal.

jabber/gtalk: pas...@jabber.fr
msn: pas...@craponne.org

bryan costanich

unread,
Dec 1, 2008, 7:24:14 PM12/1/08
to DbLinq
ok, i'm back, i've been busy on a project, but i'm back to where i
need this again. what's the current status? has it been implemented
yet? if not, can you point me in the direction i need to look in order
to get it implemented?

On Oct 5, 12:02 pm, "Pascal Craponne" <pic...@gmail.com> wrote:
> Some methods are already supported this way (when they're given an
> argument), so we can expand their behavior to FirstOrDefault() handling.
> Bryan, this could be a good way to enter the project :)
>

Pascal Craponne

unread,
Dec 2, 2008, 3:19:40 AM12/2/08
to dbl...@googlegroups.com
As far as I know, nothing's been done for this.

Anyway, by taking a look at it, it appears that FirstOrDefault method is supported, so I'm interesting in knowing what's going wrong.
There are two points where methods are handled:
1. QueryRunner.SelectScalar() handles top level method calls on expressions (according to your sample, this is the concerned point).
2. ExpressionDispatcher.AnalyzeCall() handles method calls within expressions (intermediate methods).

Pascal.

jabber/gtalk: pas...@jabber.fr
msn: pas...@craponne.org



bryan costanich

unread,
Dec 11, 2008, 10:10:08 PM12/11/08
to DbLinq
must have been the build i was using. it works now.
-b

On Dec 2, 12:19 am, "Pascal Craponne" <pic...@gmail.com> wrote:
> As far as I know, nothing's been done for this.
>
> Anyway, by taking a look at it, it appears that FirstOrDefault method is
> supported, so I'm interesting in knowing what's going wrong.
> There are two points where methods are handled:
> 1. QueryRunner.SelectScalar() handles top level method calls on expressions
> (according to your sample, this is the concerned point).
> 2. ExpressionDispatcher.AnalyzeCall() handles method calls within
> expressions (intermediate methods).
>
> Pascal.
>
> jabber/gtalk: pas...@jabber.fr
> msn: pas...@craponne.org
>
Reply all
Reply to author
Forward
0 new messages