0

I'm running into a few problems with CRUD Update (Edit) scenarios where an entity relationship is altered via drop down list of possible entities, using ASP.NET MVC and NHibernate. Probably I am just doing something stupid, so I was wondering if someone could give me a quick example of how this should be done, as I haven't been able to find many examples on the web. (There's nothing like this in NerdDinner for example)

So using an arbitrarily simple model:

Public Class Person
{
   int Id { get; set;}
   string Name { get; set}
   Person Buddy { get; set}
}

Could you give me an example (or link to an example) of the 'Update' Crud view and action(s) in this scenario?

  • Don't worry about repository code
  • For the sake of comparison with some existing code, it would be helpful if the example used formcollection (I know this is not ideal).

Thank you!

7
  • If you are running into the problems then post the problems and somebody will help you fix them. There are thousands of nhibernate examples on the web. You may have an issue specific to you. Commented Oct 7, 2010 at 12:31
  • @jfar - well I haven't been able to find an NHibernate example for this scenario with MVC - perhaps you could post one of these links? Commented Oct 7, 2010 at 12:34
  • 1
    @UpTheCreek, you do not need an MVC example. Values are values. Any 101 level NHibernate tutorial will show you how to updated nested entities. Commented Oct 7, 2010 at 12:36
  • @jfar - believe me I've spent a lot of time fiddling around with this - a working example would be very useful, and at this stage I believe the would quickest way to identify whats wrong. I'm not asking for people to write my code for me - this is an arbitrary example. Commented Oct 7, 2010 at 12:39
  • @UpTheCreek - So the burden is on everybody else to write your code for you when you could have taken the time to post your code and explain whats not working? Please post your code, that is what SO.com is designed to do. Commented Oct 7, 2010 at 12:43

1 Answer 1

1

You can try to look at Sharp architecture. They have a Northwind sample with EmployeesController and TransferValues method. There update is shown for nested entities

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks that looks promising - I'll check it out now.
Here's the link to the corresponding view code if anyones interested :github.com/codai/Sharp-Architecture/blob/master/src/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.