Upgrade NopCommerce 3.8 to 4.4 entity's navigation Properties is null

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anni tempo fa
Hi,
I am trying to upgrade NopCommerce from v3.8 to 4.4. In version 3.8, there is a Customer entity which includes Address , CustomerRoles objects. In 4.4 when I run my application these Address , CustomerRoles objects remain null, even though the data exists. Request some guidance in understanding difference between the way NopCommerce builds this object in 3.8 v/s 4.4 ? Any recommendations welcome.

Here is the code:
public virtual ICollection<Address> Addresses
        {
            get { return _addresses ?? (_addresses = new List<Address>()); }
            protected set { _addresses = value; }
        }


        /// <summary>
        /// Gets or sets the customer roles
        /// </summary>
        public virtual ICollection<CustomerRole> CustomerRoles
        {
            get { return _customerRoles ?? (_customerRoles = new List<CustomerRole>()); }
            protected set { _customerRoles = value; }
        }
------------------------------------customerService.cs

var user = await _customerService.GetCustomerByEmailAsync(EmailId);
public virtual async Task<Customer> GetCustomerByEmailAsync(string email)
        {
            if (string.IsNullOrWhiteSpace(email))
                return null;

            var query = from c in _customerRepository.Table
                        orderby c.Id
                        where c.Email == email
                        select c;
            var customer = await query.FirstOrDefaultAsync();

            return customer;
        }
2 anni tempo fa
There is no navigation property from 4.4.x to give support Linq2DB.
(upgrading from 3.X to 4.X): If you want to upgrade from a version 3.90 to the latest version, you would need to install 4.00 first (over the existing database), run the 3.90 to 4.00 migration SQL script, and then upgrade to 4.10, 4.20 etc.
Please check this link https://docs.nopcommerce.com/en/installation-and-upgrading/upgrading-nopcommerce.html
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.