NopCommerce 4.30 - LinqToDB Entity Table Name Attribute

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
I'm porting several plugins from 4.20 to 4.30 and have replaced the DBContext with my new SchemaMigration. As per the attached image I've then modified the Table Name attribute having added the LinqToDB.Mapping Namespace. However, it continues to use the class name as the table name, not my attribute.

Anyone know how I can fix this?

Many thanks in advance.

3 years ago
\Nop.Plugin.YourPlugin\Data\BaseNameCompatibility.cs

using Nop.Data.Mapping;
using Nop.Plugin.YourPlugin.Domain;
using System;
using System.Collections.Generic;

namespace Nop.Plugin.YourPlugin.Data
{
    public partial class BaseNameCompatibility : INameCompatibility
    {
        public Dictionary<Type, string> TableNames => new Dictionary<Type, string>
        {
            { typeof(YourPluginDomainEntity), "YourTableName" },
        };

        public Dictionary<(Type, string), string> ColumnName => new Dictionary<(Type, string), string>
        {
        };
    }
}
3 years ago
That's fantastic. Thank you very much.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.