BTDB.ODBLayer.ObjectDB.RegisterType C# (CSharp) Method

RegisterType() public method

public RegisterType ( Type type ) : string
type System.Type
return string
        public string RegisterType(Type type)
        {
            if (type == null) throw new ArgumentNullException(nameof(type));
            var name = Type2NameRegistry.FindNameByType(type);
            if (name != null) return name;
            name = type.Name;
            if (type.IsInterface && name.StartsWith("I", StringComparison.Ordinal)) name = name.Substring(1);
            return RegisterType(type, name);
        }

Same methods

ObjectDB::RegisterType ( Type type, string asName ) : string

Usage Example

Esempio n. 1
0
        TableInfo AutoRegisterType(Type type)
        {
            var ti = _owner.TablesInfo.FindByType(type);

            if (ti == null)
            {
                var name = _owner.Type2NameRegistry.FindNameByType(type) ?? _owner.RegisterType(type);
                ti = _owner.TablesInfo.LinkType2Name(type, name);
            }
            return(ti);
        }
All Usage Examples Of BTDB.ODBLayer.ObjectDB::RegisterType