public String GetTable()
        {
            ClassMapLoader     loader   = Database.Current.Factory.GetClassMapLoader();
            ClassMap <TEntity> classmap = loader.GetClassMap <TEntity>();

            return(String.Format(SqlSyntax.DBTABLE, classmap.GetTableName()));
        }
        public String GetField(PropertyMap aMap)
        {
            ClassMapLoader     loader   = Database.Current.Factory.GetClassMapLoader();
            ClassMap <TEntity> classmap = loader.GetClassMap <TEntity>();

            return(GetField(classmap.GetTableName(), aMap.GetColumn()));
        }
        public String GetField <TType>(Expression <Func <TEntity, TType> > anExpression)
        {
            ClassMapLoader     loader   = Database.Current.Factory.GetClassMapLoader();
            ClassMap <TEntity> classmap = loader.GetClassMap <TEntity>();
            PropertyMap        property = classmap.GetProperty(GetMemberExpression(anExpression));

            return(GetField(classmap.GetTableName(), property.GetColumn()));
        }
Exemple #4
0
 private void EnableDependency(params Type[] DependencyTablesType)
 {
     foreach (Type _tableType in DependencyTablesType)
     {
         String _table = Loader.GetClassMap(_tableType).GetTableName();
         if (Loader.HasClassMap(_tableType))
         {
             if (!SqlCacheDependencyAdmin.GetTablesEnabledForNotifications(Config.DataSource).Contains(_table))
             {
                 SqlCacheDependencyAdmin.EnableTableForNotifications(Config.DataSource, _table);
                 logger.Info("Enabling Notification For: " + _table);
             }
             else if (!MutableDependencyTablesType.Exists(m => m == _tableType))
             {
                 logger.Info("Already Enabled Notification For: " + _table);
                 MutableDependencyTablesType.Add(_tableType);
             }
         }
     }
 }
        public String GetCountField <T>()
        {
            ClassMapLoader     loader   = Database.Current.Factory.GetClassMapLoader();
            ClassMap <TEntity> classmap = loader.GetClassMap <TEntity>();

            if (classmap.Identity != null)
            {
                var _idField = GetField(classmap.Identity);
                return(String.Format(SqlSyntax.COUNT_ID_QUERY, _idField));
            }
            else
            {
                return(String.Format(SqlSyntax.COUNT_QUERY));
            }
        }
Exemple #6
0
        public String GetTable <T>() where T : class, new()
        {
            ClassMap <T> classMap = Loader.GetClassMap <T>();

            return(classMap.GetTableName());
        }