Good Morning,
Please do let me know how to check if the data is already present in the db while creating another record using ASP.Net Core6
Thank you
Good Morning,
Please do let me know how to check if the data is already present in the db while creating another record using ASP.Net Core6
Thank you
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaydeep PatilPosted Jun 8, 2022, 3:59 AM
Preetham ThangammaPosted Jun 7, 2022, 11:44 AM
Sachin SinghPosted Jun 7, 2022, 9:58 AM
why can't you use jquery in core 6?
Preetham ThangammaPosted Jun 7, 2022, 9:17 AM
Sachin SinghPosted Jun 7, 2022, 8:42 AM
Nitin SontakkePosted Jun 7, 2022, 7:50 AM
Preetham ThangammaPosted Jun 7, 2022, 7:37 AM
Nitin SontakkePosted Jun 7, 2022, 6:21 AM
To begin with, personally, I won't expect / know business layer / middleware to have this knowledge.
The question is what is your criteria of determining if record already exists, this matters a lot.
Typically all data entities expect to have a unique primary key which is numeric. If such is the case, then any corrosponding property of a model class will have 0 value. This is one way.
Another approach is to have a single stored procedure on db side responsible for insert and update as well.
This procedure can have your custom criteria of record existance checking and taking action accordingly.
Hope you understand.
Any questions, please do let me know.