Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 487555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:37:01+00:00 2026-05-13T01:37:01+00:00

Is there someplace that details how to setup your POCO’s when using the SimpleRepository

  • 0

Is there someplace that details how to setup your POCO’s when using the SimpleRepository with SubSonic 3? It sounds like it’s convention over configuration, but I can’t find where that convention is explained.

http://www.subsonicproject.com/docs/Conventions looks like it was meant for 2.0, and is also marked incomplete. (BTW: I’d love to help reorganize the docs into more a 2.0 and 3.0 as the current docs are a bit confusing on which version they are referring to.)

For instance I’d like to know how I’d go about setting up a

one-to-one relationship

User <=> Profile

class User {
  Id
  ProfileId instead of Profile? or is Profile profile possible?
}

class Profile {
  Id
  UserId instead of User? or is User user possible?
}

One-to-many relationship

class User {
  Id
  IList<Post> Posts (?) or IList<int> PostIds (?) or is this implied somehow?  or is this just wrong?
}

class Post {
  Id
  UserId instead of User? or is User user possible?
}

Many-to-many

I’m guessing I’d need to setup a many to many table?

class User {
  IList<Blog> Blogs (?) or IList<int> BlogIds (?) or is this implied somehow?
}

class BlogsUsers {  // Do I have to create this class?
  UserId
  BlogId
}

class User {
  IList<User> Users (?) or IList<int> UserIds (?) or is this implied somehow?
}

In the example solution it doesn’t seem like these are set so I’m wondering how you’d go about doing a (my guess proceeds example):

one-to-one

User.Profile

r.Single<Profile>(p=>p.User == userId);

parent on one-to-many

Post.User

id = r.Single<Post>(postId).UserId;
r.Single<User>(id); // which kind of stinks with two queries, JOIN?

children on one-to-many

User.Posts

r.Find<Post>(p=>p.UserId == userId)

or many-to-many

User.Blogs

ids = r.Find<BlogsUsers>(bu=>bu.UserId == userId);
r.Find<Blog>(b=>b.BlogId == ids);  // again with the two queries?  :)

Blog.Users

ids = r.Find<BlogsUsers>(bu=>bu.BlogId == blogId);
r.Find<User>(u=>u.UserId == ids);  // again with the two queries?  :)

I would assume that there’s got to be a way to not have the two queries and for these properties to already be autogenerated in some way. Truth be told though I did only have an hour to play with everything last night so I am a little afraid of Rob yelling at me. I’m SORRY! 😛

If these are not autogen’d then where are views and store procedures for 3.0? Please give me a link for those as well while you’re at it fellow SO’er.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:37:01+00:00Added an answer on May 13, 2026 at 1:37 am

    This is probably your best place to start:
    http://subsonicproject.com/docs/Using_SimpleRepository

    Relationships are setup in code, by you, and we don’t carry those forward to the DB (yet – hopefully soon). Ideally you setup your model as you need to and when you’re ready you go and manually “solidify” your relationships in the DB. This is to reduce friction during development – data integrity isn’t really something to worry about when building a site.

    That said, I know people want this feature – I just need to build it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.