By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,153 Members | 1,744 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,153 IT Pros & Developers. It's quick & easy.

ActiveRecord and .net

P: 1
Hi All, I hope you get to read this question. I am very new to ActiveRecord and I had this basic question.

I have a table called NetProfile where I have a column called UserGUID. This column is not a PKey and its just another colujmn in the table. I have another table called NetSearchOption that has an ID which is an int identity column plus a column called UserGUID. The relationship between these 2 tables is 1-1.

Basically, In a struggling to retrieve a Netprofile record along with NetSearchOption details for that UserGUID but the join should happen based on the profileid and not on the PKs, as UserGUID is not the PK.

So, my NetProfile class along with the ProfileGuid column also has a property called netSearchOption:

public virtual NetSearchOption NetSearchOption { get; set; }

and my NetSearchOption class has the property

public virtual Guid ProfileGuid { get; set; }

So, what kind of attributes should I need to add on both these properties so that I can basically say, give me the Netprofile record but do something like select * from NetSearchOption where profileguid=Netprofile.profileguid

Quick reply would be greatly appreciated! Thanks in advance..
Jun 8 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.