本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}