Hmm, I see the problem there. Maybe you're after a <HasMany()> with a WHERE
clause.

 

But why does the <HasManyToAny()> relationship not work as specified in this
link?

 

 
<http://www.castleproject.org/activerecord/documentation/v1rc1/usersguide/re
lations/hasmanytoany.html>
http://www.castleproject.org/activerecord/documentation/v1rc1/usersguide/rel
ations/hasmanytoany.html

 

Regards

Nick

 

-----Original Message-----

From: Nicholas Kilian [mailto:[email protected]] 

Sent: 09 April 2011 08:28 PM

To: '[email protected]'

Subject: RE: Opposite side of an "Any"

 

You may want a <HasMany()> on the other ends of the <Any()> relationships.
You need to specify the foreign key column, AR/NH will infer the rest from
the list type.

 

-----Original Message-----

From: [email protected]
[mailto:[email protected]] On Behalf Of paulddw

Sent: 09 April 2011 03:26 PM

To: Castle Project Users

Subject: Opposite side of an "Any"

 

I have a class that looks like this

 

public class Comment

{

[Any(typeof(int), MetaType=typeof(int),

    TypeColumn="RecordTypeID",

    IdColumn="RecordID",

    Cascade=CascadeEnum.SaveUpdate)]

[Any.MetaValue(1, typeof(News))]

[Any.MetaValue(2, typeof(Feature))]

public IContentItem Item

{get;set;}

}

How do I Create the Many on the News/Feature side??

 

public class News : IContentItem

{

[ManyRelationship]

public IList<Comment> Comments

{get;set;}

}

 

public class Feature : IContentItem

{

[ManyRelationship]

public IList<Comment> Comments

{get;set;}

}

Anyone got any ideas on this please I have been mucking around with this for
a few days. By the way the answer is not HasManyToAny

 

--

You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.

To post to this group, send email to
<mailto:[email protected]>
[email protected].

To unsubscribe from this group, send email to
<mailto:[email protected]>
[email protected].

For more options, visit this group at
<http://groups.google.com/group/castle-project-users?hl=en>
http://groups.google.com/group/castle-project-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to