Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to forums.ablecommerce.com. Please use your AbleCommerce username and password to Login. New Registrations are disabled.



Go to last post Go to first unread
Joe Payne @ AbleMods LLC  
#1 Posted : Thursday, July 29, 2021 11:15:19 AM(UTC)
Joe Payne @ AbleMods LLC

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 499

Thanks: 89 times
Was thanked: 14 time(s) in 13 post(s)
I'm building a WidgetParams class to hold parameters for a shopper side widget.

Is it necessary to set the [DefaultValue()] annotation on each property AND specify a default property in the default constructor of the class?

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

#2 Posted : Friday, July 30, 2021 6:14:14 AM(UTC)

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 578

Thanks: 2 times
Was thanked: 88 time(s) in 87 post(s)
Yes, it is necessary to add a default value attribute and to add the same value in the constructor.
thanks 1 user thanked shaharyar for this useful post.
Joe Payne @ AbleMods LLC on 7/30/2021(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.