source/OptimaJet.DWKit.StarterApplication/Services/ProductService.cs
/// <summary>
/// Get the ProductActions of projects that are eligible to be executed
/// </summary>
/// <returns>The ProductActions.</returns>
/// <param name="ids">Project Ids</param>
Get the ProductActions of projects that are eligible to be executed
Get the ProductActions of projects that are eligible to be executed
public async Task<IEnumerable<ProductActions>> GetProductActionsForProjectsAsync(IEnumerable<int> ids)
        {
            var products = await ProductRepository.Get()
                .Where(p => ids.Contains(p.ProjectId))
                .Include(p => p.ProductDefinition)
                .Include(p => p.Project)
                .Include(p => p.ProductWorkflow).ToListAsync();
            var productActions = (
                    from product in products
                    let actions = GetActionsForProduct(product)
                    where actions.Any()
                    select new ProductActions { Id = product.Id, Actions = actions }).ToList();
            return productActions;
        }
public async Task < IEnumerable < ProductActions > > GetProductActionsForProjectsAsync ( IEnumerable < int > ids ) { var products = await ProductRepository . Get ( ) . Where ( p => ids . Contains ( p . ProjectId ) ) . Include ( p => p . ProductDefinition ) . Include ( p => p . Project ) . Include ( p => p . ProductWorkflow ) . ToListAsync ( ) ; var productActions = ( from product in products let actions = GetActionsForProduct ( product ) where actions . Any ( ) select new ProductActions { Id = product . Id , Actions = actions } ) . ToList ( ) ; return productActions ; }
Get the ProductActions of projects that are eligible to be executed
Get the ProductActions of projects that are eligible to be executed
None
ids
IEnumerable<int>
None