The entity "Bond" has a property named "Kauf" that is another entity ("Price" = date, addedBy, value).
Now, when in Create View of Bond ( = Buy), a value for Price needs to be entered. The standard Create View has no field for entering price data.
If I add
<div class="editor-field">
@Html.EditorFor(model => model.Kauf.Value)
@Html.ValidationMessageFor(model => model.Kauf.Value)
</div>
to the view, then how would I be able to grasp that value in the controller, where regularly only the entity "Bond" is accepted as parameter?
[HttpPost]
public ActionResult Create(Bond position)
Trying to access it through
position.Kauf.Value
would just reference the (yet) empty property "Kauf" from bond, I guess. Thank you for input!
positionisnull?position.Kauf.Valuein the controller's post action?