Code help

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 năm cách đây
Hi,

I'm implementing some changes for my customer and I can't understand how the customer Class is linked to the GenericAttributeExtentions.

If I need to link my custom class to this extensions, how can I do?

Thanks, Domenico.
11 năm cách đây
Search the solution for SystemCustomerAttributeNames.Gender, to see how its used
11 năm cách đây
The problem is, I can't see the method GetAttribute from my customer class...

Like Customer.GetAttribute(...)
11 năm cách đây
GetAttribute is an extension of BaseEntity. Make sure to reference and import Nop.Services.Common and that your class derives from BaseEntity
11 năm cách đây
Yes, I did it... But it doesnt' work...
11 năm cách đây
This works for me:

        public class TestClass: BaseEntity
        {
            public string SureItWorks { get; set ; }
        }

        private void Testing()
        {
            var t = new TestClass() ;
            t.Get   <== here I get intellisense for GetAttribute
        }
11 năm cách đây
Yes, it works.

But if you write this code inside another xxx.Services project, this doesn't works.

I've referenced the all the same assembly of original Nop.Services project...

What I miss?
11 năm cách đây
You need to reference nop.services.dll for Nop.Services.Common.GenericAttributeExtentions
You need to reference nop.core.dll for Nop.Core.BaseEntity
11 năm cách đây
Yes, already did it but with no luck.
11 năm cách đây
You also need
using Nop.Core.Domain.Customers;

What doesn't work?  Are you getting a syntax error?  (what is it?)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.