MVC nhibernate entiry mapping for dropdown list

Posted by Rod McLeay on Stack Overflow See other posts from Stack Overflow or by Rod McLeay
Published on 2010-04-30T05:13:01Z Indexed on 2010/04/30 5:17 UTC
Read the original article Hit count: 398

Filed under:
|
|

Hi, I have a dropdown list on an ASP.NET MVC project that I am pretty sure is not binding to my model because of my nhibernate mapping. I have tried many variations on the asp mvc side resulting in this post here. MVC side of things seems fine I believe the issue may be that my object is trying to bind, but my mapping is out of whack.

My mapping is:

<many-to-one name="Project" lazy="false"
       class="AgileThought.ERP.Domain.Property.Project"
       column="ProjectGUID" />

My View gives an error saying that the GUID from the dropdownList selected value is not valid. Which I think may be that it is trying to push the GUID into my related project object. The value 'fd38c877-706f-431d-b624-1269184eeeb5' is invalid.

My related project list binds to the dropdown list just fine, it is just not binding to my models Project entity.

Does the related Project entity need to know about its relationship? Its really just a lookup list.

Many thanks for your time and best regards, Rod

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc