It's directly before your eyes:

var state= State.Find(...);
supplier.StatesServices.Remove(state);

supplier.Save(); // only when not using SessionScope

BTW: IF you had a bidirectional relationship, you would have to mark
one end as inverse and remove from the collection that is not inverse.

-Markus

2010/3/9 JeffoftheCubicle <jflit...@gmail.com>:
> I'm trying to understand how to delete the association between two
> classes (being accomplished with an intermediary link table) can be
> deleted without deleting either of the records linked to said
> association.  I have set up two simple classes as described here:
> http://www.davesquared.net/2008/01/messing-around-with-castle-activerecord.html
>
> For the relationship I'm using:  [HasAndBelongsToMany(
>    typeof(State), RelationType.Bag,
>    Table="Supplier_StatesServiced", ColumnKey="SupplierId",
> ColumnRef="StateId",
>    Lazy=false)
>  ]
>
> I'm sure there's something simple I'm missing but all I can manage at
> this time is deleting the data record AND the association record, not
> just the association record itself.
>
> Thanks,
>
> Jeff
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To post to this group, send email to castle-project-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> castle-project-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> 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 castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to