Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While Adding New Actor #10

Open
omkar-shah opened this issue Oct 29, 2023 · 1 comment
Open

While Adding New Actor #10

omkar-shah opened this issue Oct 29, 2023 · 1 comment

Comments

@omkar-shah
Copy link

As the actor model has Actor_Movies relation when we create new actor
(ModelState.IsValid) this function not let us add data to create new actor
what is the solution for it can you Help me out??

@salithedeveloper
Copy link

salithedeveloper commented Jan 8, 2024

I had this error as well when using .NET 8.0 framework. I resolved this by adding the [ValidateNever] tag on the Actors_Movies property of the Actor.cs file. Here is the code snippet:

//Relationships
[ValidateNever]
public List<Actor_Movie> Actors_Movies { get; set; }

I believe the issues stem from changes in how model validation works in later versions like .NET 8 (the course uses 5.0) has evolved over time, and there have been updates and changes in model binding and validation behaviors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants