Core/CafeLib.Core.Data/Caches/TableCache.cs
/// <summary>
/// Used to setup custom table conventions.
/// </summary>
/// <param name="prefix">table name prefix</param>
/// <param name="suffix">table name suffix</param>
Used to setup custom table conventions.
Used to setup custom table conventions .
public void SetupConvention(string prefix, string suffix)
        {
            _tableNames.Clear();
            _domain.GetEntityTypes().ForEach(x =>
            {
                var tableAttr = x.GetCustomAttribute<TableAttribute>(false);
                var name = tableAttr != null
                    ? tableAttr.Name
                    : $"{prefix}{(x.IsInterface && x.Name.StartsWith("I") ? x.Name.Substring(1) : x.Name)}{suffix}";
                _tableNames[x] = name;
            });
        }
public void SetupConvention ( string prefix , string suffix ) { _tableNames . Clear ( ) ; _domain . GetEntityTypes ( ) . ForEach ( x => { var tableAttr = x . GetCustomAttribute < TableAttribute > ( false ) ; var name = tableAttr != null ? tableAttr . Name : $" { prefix } { ( x . IsInterface && x . Name . StartsWith ( " " ) ? x . Name . Substring ( 1 ) : x . Name ) } { suffix } " ; _tableNames [ x ] = name ; } ) ; }
Used to setup custom table conventions.
Used to setup custom table conventions .
prefix
string
table name prefix
table name prefix
suffix
string
table name suffix
table name suffix