15 Replies
Show Payment class and how you are sending request
The Actions
Don't use database entities for input models
Don't use
virtual
either, it implies lazy loading and lazy loading is badYou mean to say I should create like a ViewModel?
Yes
The issue is that the form does not fill all of the properties of your
Payment
. Using a viewmodel that is 1:1 with what the form provides will fix thatBut before the Conditions when I debug and check I guess it should be Vaild
Okay I'll try that
Can anyone explain me how this form works btw?
I'm still in doubt how did they Payment Method that the form took as input is passed on in the object
Well, the
<select>
has asp-for
that bunds it to PaymentMethod
property of the modelHow to do this?
Do what?
its all messed up
I can't understand how these forms and action are passing values with each other
Ah I was trying to redirect that action but I see we cannot pass such complex class in the parameter or as a route id
This is my FormAction and its view takes in differen't attributes of payment class