It's very common for a Salesforce Developer to interact with data when working with Lightning Web Components.
And it's not going to be fair on Salesforce part to expect the developers to write 30-40 lines of code every time when there is some sort of interaction with the data.
So similar to Standard Controllers in Salesforce Classic there is something called Lightning Data Services in LWC.
But there is a catch we can only use it only when we want to interact with a single record.
LDS has got three tags that we can use when we want to interact with data and these are the tags
In this post, we will be looking at lightning-record-edit-form.
In the below code if I don't provide `record-id` then I can use the same tag to create a new record. If recordId is provided then we can update the record.
You can use attributes like
Hope this is helpful!