예제 #1
0
        private IQueryable <Cost> GetQueryableCostsByUserObjectTypeAndLabels(string objectType, IEnumerable <string> labels)
        {
            string[] stageDetailsFieldName;
            switch (objectType)
            {
            case core.Constants.AccessObjectType.Smo:
                stageDetailsFieldName = new [] { nameof(PgStageDetailsForm.SmoName) };
                break;

            // TODO: path key rather than name in the label from UI and change here nameof(AbstractTypeValue.Name) to nameof(AbstractTypeValue.Key)
            case core.Constants.AccessObjectType.Region:
                stageDetailsFieldName = new [] { nameof(PgStageDetailsForm.BudgetRegion), nameof(AbstractTypeValue.Name) };
                break;

            default:
                return(null);
            }

            var labelsArray = labels as string[] ?? labels.ToArray();

            return(_efContext.GetCostsByStageDetailsFieldValue(stageDetailsFieldName, labelsArray));
        }