/// <summary> /// The return value of this set of query is: <see cref="ASPNETDB_CACHE.DataSourceEntities.AspNet_SqlCacheTablesForChangeNotification"/> /// The key query criteria of this set of query is: Common. /// Common query set is a built-in set of query criteria, which will query all foreign keys, string/text value, and range of datatime /// There are 7 methods, 1 internal, 2 private and 4 public, for one set of return value and query criteria: /// internal _GetQueryOfEntityOf...(...) gives the Linq Query /// private _ExistsOfEntityOf...(...) returns true if there is any records meets Query Criteria, otherwise false /// private _GetCountOfEntityOf...(...) returns count if there is any records meets Query Criteria, otherwise 0 /// public GetCountOfEntityOf...(...) returns count if there is any records meets Query Criteria, otherwise 0 /// public ExistsOfEntityOf...(...) returns true if there is any records meets Query Criteria, otherwise false /// public GetSingleOfEntityOf...(...) returns the first record if there is any records meets Query Criteria, otherwise null /// *public GetCollectionOfEntityOf...(...) returns all records if there is any records meets Query Criteria, otherwise null /// </summary> /// <param name="currentIndex">current page index</param> /// <param name="pageSize">page size</param> /// <param name="queryOrderBySettingCollection">query OrderBy setting</param> /// <returns>result message with entity collection</returns> public MSBuildLogsExtended.DataSourceEntities.Build.DataAccessLayerMessageOfDefaultCollection GetCollectionOfDefaultOfByIdentifier( Framework.EntityContracts.QuerySystemInt64EqualsCriteria criteriaOfIdOftOfByIdentifierOfByIdentifierOfByIdentifier ,int currentIndex ,int pageSize ,Framework.EntityContracts.QueryOrderBySettingCollection queryOrderBySettingCollection ) { log.Info(string.Format("{0}: GetCollectionOfDefaultOfByIdentifier", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString())); MSBuildLogsExtended.DataSourceEntities.Build.DataAccessLayerMessageOfDefaultCollection _retMessage = new MSBuildLogsExtended.DataSourceEntities.Build.DataAccessLayerMessageOfDefaultCollection(); try { bool _Exists = _ExistsOfDefaultOfByIdentifier( criteriaOfIdOftOfByIdentifierOfByIdentifierOfByIdentifier ,currentIndex ,pageSize ,queryOrderBySettingCollection ); if (_Exists) { IQueryable<MSBuildLogsExtended.DataSourceEntities.Build.Default> _Query = _GetQueryOfDefaultOfByIdentifier( criteriaOfIdOftOfByIdentifierOfByIdentifierOfByIdentifier ,queryOrderBySettingCollection ); IEnumerable<MSBuildLogsExtended.DataSourceEntities.Build.Default> _retval; if (currentIndex == -1 || pageSize == -1) { _retval = _Query; } else { _retval = _Query.Skip(currentIndex).Take(pageSize); } _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.Success; _retMessage.Result = new MSBuildLogsExtended.DataSourceEntities.Build.DefaultCollection(); _retMessage.Result.AddRange(_retval); } else { _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.SuccessButNoResult; _retMessage.Result = null; } } catch (Exception ex) { _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.Fail; _retMessage.Result = null; _retMessage.Message = ex.Message; log.Error(string.Format("{0}: GetCollectionOfDefaultOfByIdentifier", Framework.LoggingOptions.Data_Access_Layer_Process_Failed.ToString()), ex); } log.Info(string.Format("{0}: GetCollectionOfDefaultOfByIdentifier", Framework.LoggingOptions.Data_Access_Layer_Process_Ended.ToString())); return _retMessage; }
/// <summary> /// The return value of this set of query is: <see cref="ASPNETDB_CACHE.DataSourceEntities.AspNet_SqlCacheTablesForChangeNotification"/> /// The key query criteria of this set of query is: Common. /// Common query set is a built-in set of query criteria, which will query all foreign keys, string/text value, and range of datatime /// There are 7 methods, 1 internal, 2 private and 4 public, for one set of return value and query criteria: /// internal _GetQueryOfEntityOf...(...) gives the Linq Query /// private _ExistsOfEntityOf...(...) returns true if there is any records meets Query Criteria, otherwise false /// private _GetCountOfEntityOf...(...) returns count if there is any records meets Query Criteria, otherwise 0 /// public GetCountOfEntityOf...(...) returns count if there is any records meets Query Criteria, otherwise 0 /// public ExistsOfEntityOf...(...) returns true if there is any records meets Query Criteria, otherwise false /// public GetSingleOfEntityOf...(...) returns the first record if there is any records meets Query Criteria, otherwise null /// *public GetCollectionOfEntityOf...(...) returns all records if there is any records meets Query Criteria, otherwise null /// </summary> /// <param name="currentIndex">current page index</param> /// <param name="pageSize">page size</param> /// <param name="queryOrderBySettingCollection">query OrderBy setting</param> /// <returns>result message with entity collection</returns> public MSBuildLogsExtended.DataSourceEntities.Build.DataAccessLayerMessageOfDefaultCollection GetCollectionOfDefaultOfCommon( Framework.EntityContracts.QuerySystemInt32EqualsCriteria criteriaOfIdOfSolution_S1_1OfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemStringContainsCriteria criteriaOfNameOftOfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemStringContainsCriteria criteriaOfDescriptionOftOfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemDateTimeRangeCriteria criteriaOfBuildStartTimeOftOfCommonOfCommonOfCommon ,int currentIndex ,int pageSize ,Framework.EntityContracts.QueryOrderBySettingCollection queryOrderBySettingCollection ) { log.Info(string.Format("{0}: GetCollectionOfDefaultOfCommon", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString())); MSBuildLogsExtended.DataSourceEntities.Build.DataAccessLayerMessageOfDefaultCollection _retMessage = new MSBuildLogsExtended.DataSourceEntities.Build.DataAccessLayerMessageOfDefaultCollection(); try { bool _Exists = _ExistsOfDefaultOfCommon( criteriaOfIdOfSolution_S1_1OfCommonOfCommonOfCommon ,criteriaOfNameOftOfCommonOfCommonOfCommon ,criteriaOfDescriptionOftOfCommonOfCommonOfCommon ,criteriaOfBuildStartTimeOftOfCommonOfCommonOfCommon ,currentIndex ,pageSize ,queryOrderBySettingCollection ); if (_Exists) { IQueryable<MSBuildLogsExtended.DataSourceEntities.Build.Default> _Query = _GetQueryOfDefaultOfCommon( criteriaOfIdOfSolution_S1_1OfCommonOfCommonOfCommon ,criteriaOfNameOftOfCommonOfCommonOfCommon ,criteriaOfDescriptionOftOfCommonOfCommonOfCommon ,criteriaOfBuildStartTimeOftOfCommonOfCommonOfCommon ,queryOrderBySettingCollection ); IEnumerable<MSBuildLogsExtended.DataSourceEntities.Build.Default> _retval; if (currentIndex == -1 || pageSize == -1) { _retval = _Query; } else { _retval = _Query.Skip(currentIndex).Take(pageSize); } _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.Success; _retMessage.Result = new MSBuildLogsExtended.DataSourceEntities.Build.DefaultCollection(); _retMessage.Result.AddRange(_retval); _retMessage.QueryPagingResult = new Framework.EntityContracts.QueryPagingResult { RecordCountOfCurrentPage = _retval.Count(), CountOfRecords = _Query.Count(), CurrentIndexOfStartRecord = currentIndex, PageSize = pageSize, }; } else { _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.SuccessButNoResult; _retMessage.Result = null; } } catch (Exception ex) { _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.Fail; _retMessage.Result = null; _retMessage.Message = ex.Message; log.Error(string.Format("{0}: GetCollectionOfDefaultOfCommon", Framework.LoggingOptions.Data_Access_Layer_Process_Failed.ToString()), ex); } log.Info(string.Format("{0}: GetCollectionOfDefaultOfCommon", Framework.LoggingOptions.Data_Access_Layer_Process_Ended.ToString())); return _retMessage; }