Пример #1
0
        public async Task <Framework.Models.DataAccessLayerMessageOfBoolean> ExistsOfNameValuePairByCommon(
            Framework.Queries.QuerySystemStringEqualsCriteria application
            , Framework.Queries.QuerySystemStringEqualsCriteria host
            , Framework.Queries.QuerySystemStringEqualsCriteria source
            , Framework.Queries.QuerySystemInt32EqualsCriteria statusCode
            , Framework.Queries.QuerySystemStringEqualsCriteria type
            , Framework.Queries.QuerySystemStringEqualsCriteria user
            , Framework.Queries.QuerySystemStringContainsCriteria message
            , Framework.Queries.QuerySystemStringContainsCriteria allXml
            , Framework.Queries.QuerySystemDateTimeRangeCriteria timeUtcRange
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "ExistsOfNameValuePairByCommon";
            IQueryable <Framework.Models.NameValuePair> _Query = _GetQueryOfNameValuePairByCommon(
                application
                , host
                , source
                , statusCode
                , type
                , user
                , message
                , allXml
                , timeUtcRange
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetExistsMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
Пример #2
0
        public async Task <Elmah.DataSourceEntities.ELMAH_Error.DataAccessLayerMessageOfDefaultCollection> GetCollectionOfDefaultByCommon(
            Framework.Queries.QuerySystemStringEqualsCriteria application
            , Framework.Queries.QuerySystemStringEqualsCriteria host
            , Framework.Queries.QuerySystemStringEqualsCriteria source
            , Framework.Queries.QuerySystemInt32EqualsCriteria statusCode
            , Framework.Queries.QuerySystemStringEqualsCriteria type
            , Framework.Queries.QuerySystemStringEqualsCriteria user
            , Framework.Queries.QuerySystemStringContainsCriteria message
            , Framework.Queries.QuerySystemStringContainsCriteria allXml
            , Framework.Queries.QuerySystemDateTimeRangeCriteria timeUtcRange
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCollectionOfDefaultByCommon";
            IQueryable <Elmah.DataSourceEntities.ELMAH_Error.Default> _Query = _GetQueryOfDefaultByCommon(
                application
                , host
                , source
                , statusCode
                , type
                , user
                , message
                , allXml
                , timeUtcRange
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCollectionMessageAsync <
                       Elmah.DataSourceEntities.ELMAH_Error.DataAccessLayerMessageOfDefaultCollection,
                       List <Elmah.DataSourceEntities.ELMAH_Error.Default>,
                       Elmah.DataSourceEntities.ELMAH_Error.Default>(_Query, currentIndex, pageSize, logMessageKey));
        }
Пример #3
0
        /// <param name="queryOrderBySettingCollection">query OrderBy setting</param>
        /// <returns>IQueryable&lt;...&gt; of Common</returns>
        internal IQueryable <Elmah.DataSourceEntities.ElmahHost> _GetQueryOfEntityByIdentifier(
            Framework.Queries.QuerySystemStringEqualsCriteria host
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection
            )
        {
            var _ResultFromDataSource =
                (
                    from t in this.LinqContext.ElmahHost
                    where
                    (
                        (
                            (host.IsToCompare == false || host.IsToCompare && t.Host == host.ValueToCompare)
                        )
                    )
                    select new Elmah.DataSourceEntities.ElmahHost {
                Host = t.Host
            } into x
                    select x
                );
            var _retval = _ResultFromDataSource;

            if (queryOrderBySettingCollection == null || queryOrderBySettingCollection.Count == 0)
            {
                return(_retval);
            }
            return(_retval.OrderBy(queryOrderBySettingCollection.GetOrderByExpression()));
        }
Пример #4
0
        public async Task <Framework.Models.DataAccessLayerMessageOfBoolean> ExistsOfEntityByIdentifier(
            Framework.Queries.QuerySystemStringEqualsCriteria host
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "ExistsOfEntityByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ElmahHost> _Query = _GetQueryOfEntityByIdentifier(
                host
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetExistsMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
Пример #5
0
        public async Task <Framework.Models.DataAccessLayerMessageOfInteger> GetCountOfEntityByIdentifier(
            Framework.Queries.QuerySystemStringEqualsCriteria application
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCountOfEntityByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ElmahApplication> _Query = _GetQueryOfEntityByIdentifier(
                application
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCountMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
Пример #6
0
        public async Task <Elmah.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionElmahType> GetCollectionOfEntityByIdentifier(
            Framework.Queries.QuerySystemStringEqualsCriteria type
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "GetCollectionOfEntityByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ElmahType> _Query = _GetQueryOfEntityByIdentifier(
                type
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetCollectionMessageAsync <
                       Elmah.DataSourceEntities.DataAccessLayerMessageOfEntityCollectionElmahType,
                       List <Elmah.DataSourceEntities.ElmahType>,
                       Elmah.DataSourceEntities.ElmahType>(_Query, currentIndex, pageSize, logMessageKey));
        }
Пример #7
0
        /// <param name="queryOrderBySettingCollection">query OrderBy setting</param>
        /// <returns>IQueryable&lt;...&gt; of Common</returns>
        internal IQueryable <Elmah.DataSourceEntities.ELMAH_Error.Default> _GetQueryOfDefaultByCommon(
            Framework.Queries.QuerySystemStringEqualsCriteria application
            , Framework.Queries.QuerySystemStringEqualsCriteria host
            , Framework.Queries.QuerySystemStringEqualsCriteria source
            , Framework.Queries.QuerySystemInt32EqualsCriteria statusCode
            , Framework.Queries.QuerySystemStringEqualsCriteria type
            , Framework.Queries.QuerySystemStringEqualsCriteria user
            , Framework.Queries.QuerySystemStringContainsCriteria message
            , Framework.Queries.QuerySystemStringContainsCriteria allXml
            , Framework.Queries.QuerySystemDateTimeRangeCriteria timeUtcRange
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection
            )
        {
            var _ResultFromDataSource =
                (
                    from t in this.LinqContext.ELMAH_Error
                    join ElmahApplication in this.LinqContext.ElmahApplication on t.Application equals ElmahApplication.Application
                    join ElmahHost in this.LinqContext.ElmahHost on t.Host equals ElmahHost.Host
                    join ElmahSource in this.LinqContext.ElmahSource on t.Source equals ElmahSource.Source
                    join ElmahStatusCode in this.LinqContext.ElmahStatusCode on t.StatusCode equals ElmahStatusCode.StatusCode
                    join ElmahType in this.LinqContext.ElmahType on t.Type equals ElmahType.Type
                    join ElmahUser in this.LinqContext.ElmahUser on t.User equals ElmahUser.User
                    where
                    (
                        (
                            (application.IsToCompare == false || application.IsToCompare && ElmahApplication.Application == application.ValueToCompare)
                            &&
                            (host.IsToCompare == false || host.IsToCompare && ElmahHost.Host == host.ValueToCompare)
                            &&
                            (source.IsToCompare == false || source.IsToCompare && ElmahSource.Source == source.ValueToCompare)
                            &&
                            (statusCode.IsToCompare == false || statusCode.IsToCompare && ElmahStatusCode.StatusCode == statusCode.ValueToCompare)
                            &&
                            (type.IsToCompare == false || type.IsToCompare && ElmahType.Type == type.ValueToCompare)
                            &&
                            (user.IsToCompare == false || user.IsToCompare && ElmahUser.User == user.ValueToCompare)
                        )
                        &&
                        (
                            !message.IsToCompare
                            &&
                            !allXml.IsToCompare
                            ||
                            message.IsToCompare && t.Message.Contains(message.ValueToBeContained)
                            ||
                            allXml.IsToCompare && t.AllXml.Contains(allXml.ValueToBeContained)
                        )
                        &&
                        (
                            !timeUtcRange.IsToCompare
                            ||
                            timeUtcRange.IsToCompare && (timeUtcRange.IsToCompareLowerBound == false || timeUtcRange.IsToCompareLowerBound && t.TimeUtc > timeUtcRange.LowerBound) && (timeUtcRange.IsToCompareUpperBound == false || timeUtcRange.IsToCompareUpperBound && t.TimeUtc <= timeUtcRange.UpperBound)
                        )
                    )
                    select new Elmah.DataSourceEntities.ELMAH_Error.Default {
                ElmahApplication_Name = ElmahApplication.Application, ErrorId = t.ErrorId, ElmahHost_Name = ElmahHost.Host, ElmahSource_Name = ElmahSource.Source, ElmahStatusCode_Name = ElmahStatusCode.Name, ElmahType_Name = ElmahType.Type, ElmahUser_Name = ElmahUser.User, Application = t.Application, Host = t.Host, Type = t.Type, Source = t.Source, Message = t.Message, User = t.User, StatusCode = t.StatusCode, TimeUtc = t.TimeUtc, Sequence = t.Sequence, AllXml = t.AllXml
            } into vD2
                    select vD2
                );
            var _retval = _ResultFromDataSource;

            if (queryOrderBySettingCollection == null || queryOrderBySettingCollection.Count == 0)
            {
                return(_retval);
            }
            return(_retval.OrderBy(queryOrderBySettingCollection.GetOrderByExpression()));
        }