/// <summary> /// /// </summary> /// <param name="connectiveCondition"></param> /// <param name="action"></param> /// <param name="tableName"></param> /// <param name="mappings"></param> public void LoadByBuilderInContext(ConnectiveLoadingCondition connectiveCondition, Action <TCollection> action, string tableName = null, ORMappingItemCollection mappings = null) { connectiveCondition.NullCheck("connectiveCondition"); connectiveCondition.ConnectiveBuilder.NullCheck("ConnectiveBuilder"); this.RegisterLoadByBuilderInContext( connectiveCondition.ConnectiveBuilder.ToSqlString(TSqlBuilder.Instance), connectiveCondition.OrderByBuilder, action, tableName, mappings); }
/// <summary> /// 根据外界的builder加载数据 /// </summary> /// <param name="connectiveCondition"></param> /// <returns></returns> public virtual TCollection LoadByBuilder(ConnectiveLoadingCondition connectiveCondition) { connectiveCondition.NullCheck("connectiveCondition"); connectiveCondition.ConnectiveBuilder.NullCheck("ConnectiveBuilder"); TCollection result = default(TCollection); PerformanceMonitorHelper.GetDefaultMonitor().WriteExecutionDuration(string.Format("LoadByBuilder({0})", this.GetType().FullName), () => { result = this.InnerLoadByBuilder(connectiveCondition.ConnectiveBuilder.ToSqlString(TSqlBuilder.Instance), connectiveCondition.OrderByBuilder, this.GetQueryMappingInfo()); }); return(result); }