「作成」ステートメントは次のようになります。
public ActionResult Edit(FormCollection form)
{
Usuario usuario = new Usuario
{
NomeUsuario = form["Usuario.NomeUsuario"],
IdeUsuario = form["Usuario.IdeUsuario"],
NumRegistroRM = form["Usuario.NumRegistroRM"],
SenUsuario = form["Usuario.SenUsuario"],
SituacaoUsuario = this.SituacaoUsuarioService.GetSituacaoUsuario(x => x.ID_SituacaoUsuario == Convert.ToInt32(form["Usuario.SituacaoUsuario"]// note that i have to retrieive the entire object... the "child"
};
this.UsuarioService.AddUsuario(usuario);
}
編集ステートメントは次のようになります。
TryUpdateModel(a, "Usuario", this.GetUsuarioWhiteList(), form.ToValueProvider()); // but the form contains only the id and I can't load the child in it nor pass the object.