Closed GoogleCodeExporter closed 9 years ago
I have the same problem.
SubSonic.SqlQuery sqlq = new SubSonic.Select()
.From(Dal.VwPage.Schema)
.Where(Dal.VwPage.Columns.CeuCountryWebsite).IsEqualTo(cduCountryWebsite)
.And(Dal.VwPage.Columns.TxTemplateUrl).IsEqualTo(url);
Dal.VwPage = sqlq.ExecuteSingle<Dal.VwPage>();
Windows XP, Sql Server 2005, asp.net 2.0, SubSonic 2.1 Final
Original comment by ricardoc...@gmail.com
on 9 Feb 2009 at 12:51
ExecuteSingle<T> returns default(T) if there's no record found which is null
for
reference types. I'm not a big fan of the null object pattern so I would prefer
the
ExecuteSingle behavior be replicated with DB.Get<T> since I always have to
handle empty
objects myself. Just my $.02
Original comment by rimsyst...@gmail.com
on 1 Apr 2009 at 3:54
Oops, posted the previous comment under the wrong account. Anyway, there's a
conflict
here with Issue 20 who wants the opposite of what you want.
Original comment by johnshee...@gmail.com
on 1 Apr 2009 at 3:56
I've moved to returning null if object not in DB - closing
Original comment by robcon...@gmail.com
on 9 Apr 2009 at 2:01
[deleted comment]
therefore, does it mean that "IsLoaded" property is pretty much useless? this
really
is not a big deal but it breaks backward compatibility. wherever we use
"x.IsLoaded"
to check the object existance we have to change to "x != null" otherwise an
exception
will be thrown.
Original comment by ylw...@gmail.com
on 13 Apr 2009 at 5:32
Ugh - yah I thought about it but it's better design. Interesting discussion...
Original comment by robcon...@gmail.com
on 13 Apr 2009 at 6:08
Original issue reported on code.google.com by
ylw...@gmail.com
on 12 Nov 2008 at 8:19