7 Replies
Basically I want to create a object of the Payment class and add it in the DB.
So before that I would need all attributes of it so how can I proceed with it
You should create a DTO — a class with only properties or a record — that has all the same properties your form does
That will be the parameter in your POST method
And based on that data, construct what you need and save it
Can I have like
Does
Payment
contain all the properties the form does and only the properties the form does?
Seeing how it's your database entity, I'd wager that no, it does not
So just make a new classits like there is only "One" new property I need from the Form that is the Payment Method and rest all properties are in with relations with other Classes objects
You already have my answer
It's not likely to change
okayy