public async Task <CosmosListPage <RMA> > ListRMAsByOrderID(string orderID, CommerceRole commerceRole, MeUser me, bool accessAllRMAsOnOrder = false) { return(await _rmaCommand.ListRMAsByOrderID(orderID, commerceRole, me, accessAllRMAsOnOrder)); }
public virtual async Task <CosmosListPage <RMA> > ListRMAsByOrderID(string orderID, CommerceRole commerceRole, MeUser me, bool accessAllRMAsOnOrder = false) { string sourceOrderID = orderID.Split("-")[0]; CosmosListOptions listOptions = new CosmosListOptions() { PageSize = 100 }; IQueryable <RMA> queryable = _rmaRepo.GetQueryable() .Where(rma => rma.PartitionKey == "PartitionValue" && rma.SourceOrderID == sourceOrderID); if (commerceRole == CommerceRole.Supplier && !accessAllRMAsOnOrder) { queryable = QueryOnlySupplierRMAs(queryable, me.Supplier.ID); } CosmosListPage <RMA> rmas = await GenerateRMAList(queryable, listOptions); return(rmas); }