public string GetEntitySchemaDefClassQualifiedName(EntityDefinition entity, bool addNamespace)
 {
     if (entity.NeedOwnSchema())
     {
         return(string.Format("{0}.{1}", GetEntityClassName(entity, addNamespace), GetEntitySchemaDefClassName(entity)));
     }
     else
     {
         return(GetEntitySchemaDefClassQualifiedName(entity.BaseEntity, true));
     }
 }
        protected virtual void OnPopulateMembers(object sender, EventArgs e)
        {
            if ((_settings.GenerateMode.HasValue ? _settings.GenerateMode.Value : _entity.Model.GenerateMode) != GenerateModeEnum.SchemaOnly)
            {
                PopulateDontRaise();
                OnPopulatePropertiesAccessors();
                if (_entity.GetPkProperties().Count() > 0 &&
                    (_settings.GenerateMode.HasValue ? _settings.GenerateMode.Value : _entity.Model.GenerateMode) != GenerateModeEnum.EntityOnly)
                {
                    OnPupulateEntityRelations();
                    OnPupulateM2MRelations();
                }
            }

            if ((_settings.GenerateMode.HasValue ? _settings.GenerateMode.Value : _entity.Model.GenerateMode) != GenerateModeEnum.EntityOnly)
            {
                if (_entity.NeedOwnSchema())
                {
                    OnPopulateSchema();
                }
            }
            //else
            //    throw new NotImplementedException();
        }