Exemple #1
0
 private static IList <T> DoLoadObjects <T>(IDbCommand cmd)
     where T : class, IAlbianObject, new()
 {
     try
     {
         IQueryCluster query   = new QueryCluster();
         IList <T>     targets = query.QueryObjects <T>(cmd);
         ResultCache.CachingObjects(cmd, targets);
         return(targets);
     }
     catch (Exception exc)
     {
         if (null != Logger)
         {
             Logger.ErrorFormat("Find Object is error..info:{0}.", exc.Message);
         }
         throw;
     }
 }
Exemple #2
0
 private static T DoLoadObject <T>(string routingName, IFilterCondition[] where)
     where T : class, IAlbianObject, new()
 {
     try
     {
         ITaskBuilder  taskBuilder = new TaskBuilder();
         ITask         task        = taskBuilder.BuildQueryTask <T>(routingName, 0, where, null);
         IQueryCluster query       = new QueryCluster();
         T             target      = query.QueryObject <T>(task);
         ResultCache.CachingObject(routingName, where, target);
         return(target);
     }
     catch (Exception exc)
     {
         if (null != Logger)
         {
             Logger.ErrorFormat("load Object is error..info:{0}.", exc.Message);
         }
         throw;
     }
 }
Exemple #3
0
 private static IList <T> DoLoadObjects <T>(string routingName, int top, IFilterCondition[] where,
                                            IOrderByCondition[] orderby)
     where T : class, IAlbianObject, new()
 {
     try
     {
         ITaskBuilder  taskBuilder = new TaskBuilder();
         ITask         task        = taskBuilder.BuildQueryTask <T>(routingName, top, where, orderby);
         IQueryCluster query       = new QueryCluster();
         IList <T>     targets     = query.QueryObjects <T>(task);
         ResultCache.CachingObjects(routingName, top, where, orderby, targets);
         return(targets);
     }
     catch (Exception exc)
     {
         if (null != Logger)
         {
             Logger.ErrorFormat("Find Object is error..info:{0}.", exc.Message);
         }
         throw;
     }
 }