/// <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 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="queryOrderBySettingCollection">query OrderBy setting</param> /// <returns>result message with single entity</returns> public MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityBuildLog GetSingleOfEntityOfCommon( Framework.EntityContracts.QuerySystemInt64EqualsCriteria criteriaOfIdOfBuild_B1_1OfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemInt32EqualsCriteria criteriaOfIdOfSolution_S1_1OfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemInt32EqualsCriteria criteriaOfIdOfBuildEventCode_B2_1OfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemStringContainsCriteria criteriaOfMessageOftOfCommonOfCommonOfCommon ,Framework.EntityContracts.QuerySystemDateTimeRangeCriteria criteriaOfEventTimeOftOfCommonOfCommonOfCommon ,Framework.EntityContracts.QueryOrderBySettingCollection queryOrderBySettingCollection ) { log.Info(string.Format("{0}: GetSingleOfEntityOfCommon", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString())); MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityBuildLog _retMessage = new MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityBuildLog(); try { bool _Exists = _ExistsOfEntityOfCommon( criteriaOfIdOfBuild_B1_1OfCommonOfCommonOfCommon ,criteriaOfIdOfSolution_S1_1OfCommonOfCommonOfCommon ,criteriaOfIdOfBuildEventCode_B2_1OfCommonOfCommonOfCommon ,criteriaOfMessageOftOfCommonOfCommonOfCommon ,criteriaOfEventTimeOftOfCommonOfCommonOfCommon ,-1 ,-1 ,queryOrderBySettingCollection ); if (_Exists) { IQueryable<MSBuildLogsExtended.DataSourceEntities.BuildLog> _Query = _GetQueryOfEntityOfCommon( criteriaOfIdOfBuild_B1_1OfCommonOfCommonOfCommon ,criteriaOfIdOfSolution_S1_1OfCommonOfCommonOfCommon ,criteriaOfIdOfBuildEventCode_B2_1OfCommonOfCommonOfCommon ,criteriaOfMessageOftOfCommonOfCommonOfCommon ,criteriaOfEventTimeOftOfCommonOfCommonOfCommon ,queryOrderBySettingCollection ); MSBuildLogsExtended.DataSourceEntities.BuildLog _retval = _Query.SingleOrDefault(); _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.Success; _retMessage.Result = _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}: GetSingleOfEntityOfCommon", Framework.LoggingOptions.Data_Access_Layer_Process_Failed.ToString()), ex); } log.Info(string.Format("{0}: GetSingleOfEntityOfCommon", 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 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="queryOrderBySettingCollection">query OrderBy setting</param> /// <returns>result message with single entity</returns> public MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityBuildLog GetSingleOfEntityOfAll( Framework.EntityContracts.QueryOrderBySettingCollection queryOrderBySettingCollection ) { log.Info(string.Format("{0}: GetSingleOfEntityOfAll", Framework.LoggingOptions.Data_Access_Layer_Process_Started.ToString())); MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityBuildLog _retMessage = new MSBuildLogsExtended.DataSourceEntities.DataAccessLayerMessageOfEntityBuildLog(); try { bool _Exists = _ExistsOfEntityOfAll( -1 ,-1 ,queryOrderBySettingCollection ); if (_Exists) { IQueryable<MSBuildLogsExtended.DataSourceEntities.BuildLog> _Query = _GetQueryOfEntityOfAll( queryOrderBySettingCollection ); MSBuildLogsExtended.DataSourceEntities.BuildLog _retval = _Query.SingleOrDefault(); _retMessage.DataAccessLayerMessageStatus = Framework.DataSourceEntities.DataAccessLayerMessageStatus.Success; _retMessage.Result = _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}: GetSingleOfEntityOfAll", Framework.LoggingOptions.Data_Access_Layer_Process_Failed.ToString()), ex); } log.Info(string.Format("{0}: GetSingleOfEntityOfAll", Framework.LoggingOptions.Data_Access_Layer_Process_Ended.ToString())); return _retMessage; }