Example #1
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));
        }
Example #2
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));
        }
        /// <param name="queryOrderBySettingCollection">query OrderBy setting</param>
        /// <returns>IQueryable&lt;...&gt; of Common</returns>
        internal IQueryable <Elmah.DataSourceEntities.ElmahStatusCode> _GetQueryOfEntityByIdentifier(
            Framework.Queries.QuerySystemInt32EqualsCriteria statusCode
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection
            )
        {
            var _ResultFromDataSource =
                (
                    from t in this.LinqContext.ElmahStatusCode
                    where
                    (
                        (
                            (statusCode.IsToCompare == false || statusCode.IsToCompare && t.StatusCode == statusCode.ValueToCompare)
                        )
                    )
                    select new Elmah.DataSourceEntities.ElmahStatusCode {
                StatusCode = t.StatusCode, Name = t.Name
            } into x
                    select x
                );
            var _retval = _ResultFromDataSource;

            if (queryOrderBySettingCollection == null || queryOrderBySettingCollection.Count == 0)
            {
                return(_retval);
            }
            return(_retval.OrderBy(queryOrderBySettingCollection.GetOrderByExpression()));
        }
        public async Task <Framework.Models.DataAccessLayerMessageOfBoolean> ExistsOfEntityByIdentifier(
            Framework.Queries.QuerySystemInt32EqualsCriteria statusCode
            , int currentIndex = -1
            , int pageSize     = -1
            , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection = null
            )
        {
            const string logMessageKey = "ExistsOfEntityByIdentifier";
            IQueryable <Elmah.DataSourceEntities.ElmahStatusCode> _Query = _GetQueryOfEntityByIdentifier(
                statusCode
                , queryOrderBySettingCollection
                );

            return(await Elmah.EntityFrameworkDAL.IQueryableHelper.GetExistsMessageAsync(_Query, currentIndex, pageSize, logMessageKey));
        }
Example #5
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()));
        }