Code help

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 yıl önce
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 yıl önce
Search the solution for SystemCustomerAttributeNames.Gender, to see how its used
11 yıl önce
The problem is, I can't see the method GetAttribute from my customer class...

Like Customer.GetAttribute(...)
11 yıl önce
GetAttribute is an extension of BaseEntity. Make sure to reference and import Nop.Services.Common and that your class derives from BaseEntity
11 yıl önce
Yes, I did it... But it doesnt' work...
11 yıl önce
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 yıl önce
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 yıl önce
You need to reference nop.services.dll for Nop.Services.Common.GenericAttributeExtentions
You need to reference nop.core.dll for Nop.Core.BaseEntity
11 yıl önce
Yes, already did it but with no luck.
11 yıl önce
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.