sharparchitecture/Sharp-Architecture — Issue #35: SharpModelBinder does not bind child entities
Author: seif
Created: 2012-01-09 01:16:49+00:00
State: open

There seems to be a problem in EntityValueBinder where when the view has

@Html.HiddenFor(m => m.Entity.ChildEntity.Id)

It does not bind the ChildEntity properly, but requires a change to

https://github.com/sharparchitecture/Sharp-Architecture/blob/master/Solutions/SharpArch.Web.Mvc/ModelBinder/EntityValueBinder.cs#L23

to become

var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName + ".Id");

Originally noticed problem when reported problem for SharpLite in this commit:
https://github.com/seif/DevelopmentStack/commit/520a2e0eaa783a85fa4c77de4ea25ede5b49a7af