1

Its my first time to work on MVC framework and I am creating a shopping cart application.

I have three tables like product, order, orderDetail. First I configured only product and create a view using product control. when I run this I got an error like

The model item passed into the dictionary is of type 'System.Data.Objects.ObjectSet`1 [MvcShoppingCart.Models.Product]', but this dictionary requires a model item of type 'MvcShoppingCart.Models.Product'. "

If anyone have the solution please reply

2
  • Could you post your code on your product controller.. Commented Dec 15, 2011 at 7:29
  • Put a breakpoint in your code on the line where the error happens, to trace the circumstances of the error. Commented Dec 15, 2011 at 7:52

2 Answers 2

1

This exception tells you that you pass an ObjectSet (from Entity Framework?) to a view as model where the view expects a Product instance.

Sign up to request clarification or add additional context in comments.

Comments

0

Have you tried to work on

ASP.NET MVC TUTORIAL

This might help you to start.

Regards

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.