Hi @hamid Darab ,
So how is it possible to Exclude some of my Model properties from ASP.NET Core Model Binding? (for example the Id property is Primary Key and generated Automatically by Database. I want the ModelStae.IsValide doesn't produce error when Id property is not found in Client-to-server json response)
Agree with AgaveJoe, a ViewModel with the required properties is the easiest method.
If you don't want to use this method, you could try to use a custom model binder to get the transfer data from the request body, then return a valid model to the API action method.
Refer to the following article to use custom model binder:
Custom Model Binding in ASP.NET Core
Custom Model Binding In ASP.NET Core MVC
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion