mosh-hamedani / vidly-mvc-5

951 stars 1.52k forks source link

Issue related with adding new rental details fetching from form by using ajax call #17

Open DhanyaMenon opened 7 years ago

DhanyaMenon commented 7 years ago

The auto complete feature works fine for me in both movies and customer fields. But when I submit the form I am getting a 500 network error (null pointer exception) for movieids. However, if I submit the data using postmaster calling the API, it works fine. I have attached the error code and the form data that I get as I submit the form. formdataloaded

The moviesId array appear to be in a different format from the one we submit using API. Can someone help me with this?

Exception Error :An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: Unable to create a null constant value of type 'System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. Only entity types, enumeration types or primitive types are supported in this context.

afaf-tech commented 4 years ago

I have the same error as you. but I don' know what's wrong.

rodrigofontes15 commented 4 years ago

Same error here....

mohieey commented 4 years ago

In the ajax code when mosh added the movieIds property in the vm object, he named it movieIds not moviesIds like the name of the property in the NewRentalDto, I changed the name of movieIds to moviesIds in the ajax code and it worked