Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SharpModelBinder does not bind child entities #35

Closed
seif opened this Issue · 0 comments

1 participant

@seif
Owner

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:
seif/DevelopmentStack@520a2e0

@seif seif closed this issue from a commit
@seif seif Closes #35
Not sure if the old code was providing any particular behaviour, so try the old method of getting the value first then try to get the value through Id property.

The "Id" is already hard coded around the coded.
e6f7e39
@seif seif closed this in e6f7e39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.