Code help

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

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