SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict darkwater23's Avatar
    Join Date
    Nov 2005
    Location
    Omaha, NE
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SubSonic method explanation needed

    hey all!

    I posted this question in SubSonic's forum, but their forum seems pretty dead. I've only posted 4 times and I'm ranked as one of the most active users!

    If anyone has any insight, I'd appreciate it. The documentation for SubSonic stuff isn't very detailed or easy to find.

    SubsonicNamespace.GeneratedClassname object = new SubsonicNamespace.GeneratedClassname(string columnName,object columnValue);

    When you pass in a column name and a value, I can't tell exactly what it's trying to do. It's creating an object even if no records exist in the table. It looks like it is intended to try and query the database for that column and value. What if there is more than one record that matches? Does it return just the first record or does it have a collection attached to it?

    Thanks for looking!

  2. #2
    SitePoint Addict darkwater23's Avatar
    Join Date
    Nov 2005
    Location
    Omaha, NE
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I never did find an explanation for how that method works, but I found a way to get the result I wanted that's even better!

    SubsonicNamespace.GeneratedClassname dataObject = new SubSonic.Select().From(SubsonicNamespace.GeneratedClassname.Schema).Where("ColumnName").IsNull().ExecuteSingle<SubsonicNamespace.GeneratedClassname>();

  3. #3
    SitePoint Evangelist praetor's Avatar
    Join Date
    Aug 2005
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <stupid question>
    Why don't you use Linq?
    </stupid question>

  4. #4
    SitePoint Addict darkwater23's Avatar
    Join Date
    Nov 2005
    Location
    Omaha, NE
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My company is using Linq on new projects, but this project was already a Subsonic project, so for consistency, I'm trying to use Subsonic.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •