UpdateModel vs Request.Form..
-
Hi, Is there a reason one would prefere Request.Form instead of the UpdateModel(..)? Another question: If one haves a class (generated by linq to sql) with two properties like: SomethingId, Something Being SomethingId an int and Something the object, For example: Table Messages {...,FromId, ..} is mapped to Class Message {...,FromId, From, ...} Being From an object of lets say type User So, my question is how is the procedure to edit these kind of objects if I'm using Request.Form? Between A and B: Way A: 1. Retrieve the object obj being edited from the repository, obj = objsRepository.RetrieveById(..) 2. x = Request.Form["SomethingId"] 3. obj.SomethingId = x vs Way B: 1. Retrieve the object obj being edited from the repository, obj = objsRepository.RetrieveById(..) 2. x = Request.Form["SomethingId"] 3. xAsObject = somethingsRepository.RetrieveById(x) 4. obj.Something = xAsObject Which one is the correct way ?? (Of course in my form I wont have "objects".. just strings)