Closed kimbaudi closed 7 years ago
This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request. Thanks, .NET Foundation Pull Request Bot
@kimbaudi thanks for sending this updated PR. I wonder if this has been broken for a long time when MVC changed the default JSON serialization to use camelCase instead of PascalCase?
@Eilon I believe MVC recently started using camelCase by default since 1.1.0 (so not too long ago).
Actually it was changed right before 1.0.0 RTM: https://github.com/aspnet/Announcements/issues/194
Anyway, the change looks good, so I'll merge!
This pull request fixes an issue with RemoveFromCart. Currently, the RemoveFromCart method in ShoppingCartController returns a ShoppingCartRemoveViewModel as a JsonResult that has properties which are PascalCase (i.e., Message, CartTotal, CartCount, ItemCount, DeleteId). However, the jQuery ajax call gets the data as camelCase (i.e., message, cartTotal, cartCount, itemCount, deleteId). As a result, removing an item from the cart isn't working correctly. Changing the JSON from PascalCase to camelCase fixes the problem.