当前位置: 首页>>代码示例>>C#>>正文


C# IQueryable.AsExpandable方法代码示例

本文整理汇总了C#中IQueryable.AsExpandable方法的典型用法代码示例。如果您正苦于以下问题:C# IQueryable.AsExpandable方法的具体用法?C# IQueryable.AsExpandable怎么用?C# IQueryable.AsExpandable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IQueryable的用法示例。


在下文中一共展示了IQueryable.AsExpandable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FilterWorkflowStatus

 /// <summary>
 /// Filter by workflow status
 /// </summary>
 /// <param name="filters">Filters</param>
 /// <param name="queryfiltered">Query to filter</param>
 /// <returns>Query filtered</returns>
 private static IQueryable<Certificate> FilterWorkflowStatus(CertificateFilterModel filters, IQueryable<Certificate> queryfiltered)
 {
     //workflow status condition
     if (filters.Created || filters.Requested || filters.Approved || filters.Rejected || filters.Ongoing || filters.Closed)
     {
         var predicateWorkflowStatus = PredicateBuilder.False<Certificate>();
         if (filters.Created)
             predicateWorkflowStatus = predicateWorkflowStatus.Or(c => c.WorkflowStatusId == WorkflowStatusEnum.Created);
         if (filters.Requested)
             predicateWorkflowStatus = predicateWorkflowStatus.Or(c => c.WorkflowStatusId == WorkflowStatusEnum.Requested);
         if (filters.Approved)
             predicateWorkflowStatus = predicateWorkflowStatus.Or(c => c.WorkflowStatusId == WorkflowStatusEnum.Approved);
         if (filters.Rejected)
             predicateWorkflowStatus = predicateWorkflowStatus.Or(c => c.WorkflowStatusId == WorkflowStatusEnum.Rejected);
         if (filters.Ongoing)
             predicateWorkflowStatus = predicateWorkflowStatus.Or(c => c.WorkflowStatusId == WorkflowStatusEnum.Ongoing);
         if (filters.Closed)
             predicateWorkflowStatus = predicateWorkflowStatus.Or(c => c.WorkflowStatusId == WorkflowStatusEnum.Closed);
         queryfiltered = queryfiltered.AsExpandable().Where(predicateWorkflowStatus);
     }
     return queryfiltered;
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:28,代码来源:QuereableExtensions.cs

示例2: FilterInvoiced

 /// <summary>
 /// Filter by invoiced or non invoiced
 /// </summary>
 /// <param name="filters">Filters</param>
 /// <param name="queryfiltered">Query to filter</param>
 /// <returns>Query filtered</returns>
 private static IQueryable<Certificate> FilterInvoiced(CertificateFilterModel filters, IQueryable<Certificate> queryfiltered)
 {
     //filter by invoice
     if (filters.Invoiced || filters.NonInvoiced)
     {
         var predicateInvoiced = PredicateBuilder.False<Certificate>();
         if (filters.Invoiced)
             predicateInvoiced = predicateInvoiced.Or(c => c.IsInvoiced == true);
         if (filters.NonInvoiced)
             predicateInvoiced = predicateInvoiced.Or(c => c.IsInvoiced == false);
         queryfiltered = queryfiltered.AsExpandable().Where(predicateInvoiced);
     }
     return queryfiltered;
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:20,代码来源:QuereableExtensions.cs

示例3: FilterPublishNonPublish

 /// <summary>
 /// Filter by publish or non publish
 /// </summary>
 /// <param name="filters">Filters</param>
 /// <param name="queryfiltered">Query to filter</param>
 /// <returns>Query filtered</returns>
 private static IQueryable<Certificate> FilterPublishNonPublish(CertificateFilterModel filters, IQueryable<Certificate> queryfiltered)
 {
     //publish non-publish condition
     if (filters.Published || filters.Unpublished)
     {
         var predicatePublisUnpublish = PredicateBuilder.False<Certificate>();
         if (filters.Published)
             predicatePublisUnpublish = predicatePublisUnpublish.Or(c => c.IsPublished == true);
         if (filters.Unpublished)
             predicatePublisUnpublish = predicatePublisUnpublish.Or(c => c.IsPublished == false);
         queryfiltered = queryfiltered.AsExpandable().Where(predicatePublisUnpublish);
     }
     return queryfiltered;
 }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:20,代码来源:QuereableExtensions.cs

示例4: FilterCertificateStatusBoderAgent

        /// <summary>
        /// Filter by certificate status for a border agent
        /// </summary>
        /// <param name="filters">Filters</param>
        /// <param name="queryfiltered">Query to filter</param>
        /// <returns>Query filtered</returns>
        private static IQueryable<Certificate> FilterCertificateStatusBoderAgent(CertificateFilterModel filters, IQueryable<Certificate> queryfiltered)
        {
            var predicateCertificateStatus = PredicateBuilder.False<Certificate>();
            if (filters.Conform || filters.NonConform)
            {
                if (filters.Conform)
                    predicateCertificateStatus = predicateCertificateStatus.Or(c => c.CertificateStatusId == CertificateStatusEnum.Conform);
                if (filters.NonConform)
                    predicateCertificateStatus = predicateCertificateStatus.Or(c => c.CertificateStatusId == CertificateStatusEnum.NonConform);
                queryfiltered = queryfiltered.AsExpandable().Where(predicateCertificateStatus);
            }

            queryfiltered = queryfiltered.Where(c => c.CertificateStatusId != CertificateStatusEnum.Cancelled);

            return queryfiltered;
        }
开发者ID:ramirobr,项目名称:VOCIraq,代码行数:22,代码来源:QuereableExtensions.cs


注:本文中的IQueryable.AsExpandable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。