Hi
I have an issue when it come to removing/deleting items from a
collection and persist the changes.
I got to models
Blog and Post
(this is simplified)
public class Blog
{
[HasMany(typeof(Post),
Table = "Posts",
ColumnKey = "BlogId",
Access = PropertyAccess.NosetterCamelcase,
RelationType = RelationType.Bag,
Cascade = ManyRelationCascadeEnum.SaveUpdate
)]
private IList<Post> PostList
{
get { return postlist; }
}
public void AddPost(Post post)
{
postlist.Add(post);
}
public void RemovePost(Post post)
{
postlist.Remove(post);
}
}
I can added just fine, but when i try to remove/delete and persist a
Post then 2 things can happen..
1. It complains that the columnkey cant be null
2. It sets the columnkey to zero for the given post (dont remember how
i got it to do this)
Need some help on why the Post aint deleted in the DB, i would have
thought that i would do so, when i remove it from the PostList and
then do Blog.Save().
best regards,
Mark
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---