private Entity CreateEntity(EntityContext entityContext, TabularObjectBase tableSchema)
        {
            var entity = new Entity
            {
                FullName    = tableSchema.FullName,
                TableName   = tableSchema.Name,
                TableSchema = tableSchema.Owner
            };

            string className = ToClassName(tableSchema.Name);

            className = _namer.UniqueClassName(className);

            string mappingName = className + "Map";

            mappingName = _namer.UniqueClassName(mappingName);

            string contextName = Settings.ContextName(className);

            contextName = ToPropertyName(entityContext.ClassName, contextName);
            contextName = _namer.UniqueContextName(contextName);

            entity.ClassName   = className;
            entity.ContextName = contextName;
            entity.MappingName = mappingName;

            entityContext.Entities.Add(entity);

            return(entity);
        }
Пример #2
0
        private Entity CreateEntity(EntityContext entityContext, TabularObjectBase tableSchema)
        {
            var entity = new Entity
            {
                FullName = tableSchema.FullName,
                TableName = tableSchema.Name,
                TableSchema = tableSchema.Owner
            };

            string className = ToClassName(tableSchema.Name);
            className = _namer.UniqueClassName(className);

            string mappingName = className + "Map";
            mappingName = _namer.UniqueClassName(mappingName);

            string contextName = Settings.ContextName(className);
            contextName = ToPropertyName(entityContext.ClassName, contextName);
            contextName = _namer.UniqueContextName(contextName);

            entity.ClassName = className;
            entity.ContextName = contextName;
            entity.MappingName = mappingName;

            entityContext.Entities.Add(entity);

            return entity;
        }