How to add a new property.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 Jahre weitere
Hello,

I am following this document to do it.

http://docs.nopcommerce.com/pages/viewpage.action?pageId=1442499

But I got stuck when I come to the controller.  I did not get what to do with this

"Normally I would write tests for the following code and verify that model mapping is working correctly, but I'll skip unit testing to keep it simple.
In the appropriate methods ("Create", "Edit", or "PrepareSomeModel") add the code to set this property. In most case it's not required because it's automatically handled by AutoMapper in the .ToModel() method.
In the public method to save entity (usually: "Create" or "Edit" methods with [HttpPost] attribute)
// Edit View Model -> Data Model
category.SomeNewProperty = model.SomeNewProperty;"

And When I run the project, It give error.
7 Jahre weitere
[email protected] wrote:
Hello,

I am following this document to do it.

http://docs.nopcommerce.com/pages/viewpage.action?pageId=1442499

But I got stuck when I come to the controller.  I did not get what to do with this

"Normally I would write tests for the following code and verify that model mapping is working correctly, but I'll skip unit testing to keep it simple.
In the appropriate methods ("Create", "Edit", or "PrepareSomeModel") add the code to set this property. In most case it's not required because it's automatically handled by AutoMapper in the .ToModel() method.
In the public method to save entity (usually: "Create" or "Edit" methods with [HttpPost] attribute)
// Edit View Model -> Data Model
category.SomeNewProperty = model.SomeNewProperty;"

And When I run the project, It give error.


Could you share error details? And I like to suggest you read the above link carefully to find out what you missed.
7 Jahre weitere
Thanks for your answer.

I am already following that link but I do not understand what I am supposed to change in the controller.

It throws me to the categoryservice.cs
7 Jahre weitere
[email protected] wrote:
Thanks for your answer.

I am already following that link but I do not understand what I am supposed to change in the controller.

It throws me to the categoryservice.cs


Could you debug the code?

I wanted to see exact error. You can see error details from Admin Log
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.