Example #1
0
        async Task <int[]> GetMembers(int orderId, SendTarget target)
        {
            var order = await orderingService.GetOrder(orderId);

            switch (target)
            {
            case OrderOpener _: return(new[] { order.RequestingMemberId });

            case MemberTarget mt:
                var unitId  = mt.OrderSide == OrderSide.Lending ? order.LendingUnitId : order.RequestingUnitId;
                var members = await orderingService.GetMembers(unitId, mt.Permission);

                return(members.Select(a => a.Id).ToArray());
            }

            return(new int[0]);
        }