Hi!
I'm trying to update a parent and their children entities at once, but
NH is updating to NULL the FK on Task table.
Simplifing I have:
[ActiveRecord]
public class Checklist : ActiveRecordAuditBase<Checklist>
{
(...)
[HasMany(typeof(Task),
BatchSize = 50,
Cascade = ManyRelationCascadeEnum.AllDeleteOrphan,
Lazy = false,
Inverse = false)]
public IList<Task> Tasks
{
get { return this._tasks; }
set { this._tasks = value; }
}
(...)
}
On my view:
$FormHelper.HiddenField("checklist.Id")
#foreach($task in $checklist.Tasks)
$FormHelper.TextArea("checklist.Tasks[${index}].Comment")
$FormHelper.HiddenField("checklist.Tasks[${index}].Id")
#end
On my controller:
public void Update([ARDataBind("checklist", AutoLoad =
AutoLoadBehavior.Always)] Checklist checklist)
{
checklist.Update();
RedirectToAction("list");
}
If I use inverse=true, ARDataBind does not put view values onto
checklist object.
Any help is more than welcome!!
Thanks!!
yorch.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---