Example #1
0
        public void SchemaTypeSelectionViewModel_PageLeaving(object sender, EventArgs args)
        {
            var model = EdmHelper.GetEdmModelFromFile(ConfigODataEndpointViewModel.MetadataTempPath);

            // exclude related operation imports for excluded types
            var operations          = EdmHelper.GetOperationImports(model);
            var operationsToExclude = operations.Where(x => !OperationImportsViewModel.IsOperationImportIncluded(x,
                                                                                                                 SchemaTypesViewModel.ExcludedSchemaTypeNames.ToList())).ToList();

            foreach (var operationImport in OperationImportsViewModel.OperationImports)
            {
                if (operationsToExclude.Any(x => x.Name == operationImport.Name))
                {
                    operationImport.IsSelected = false;
                }
            }

            // exclude bound operations for excluded types
            var boundOperations          = EdmHelper.GetBoundOperations(model);
            var boundOperationsToExclude = boundOperations.SelectMany(x => x.Value)
                                           .Where(x => !SchemaTypesViewModel.IsBoundOperationIncluded(x,
                                                                                                      SchemaTypesViewModel.ExcludedSchemaTypeNames.ToList())).ToList();

            foreach (var boundOperation in SchemaTypesViewModel.SchemaTypes.SelectMany(x => x.BoundOperations))
            {
                if (boundOperationsToExclude.Any(x => $"{x.Name}({x.Parameters.First().Type.Definition.FullTypeName()})" == boundOperation.Name))
                {
                    boundOperation.IsSelected = false;
                }
            }
        }
Example #2
0
        public void SchemaTypeSelectionViewModel_PageLeaving(object sender, EventArgs args)
        {
            // exclude related operationimports for excluded types
            var model               = EdmHelper.GetEdmModelFromFile(ConfigODataEndpointViewModel.MetadataTempPath);
            var operations          = EdmHelper.GetOperationImports(model);
            var operationsToExclude = operations.Where(x => !OperationImportsViewModel.IsOperationImportIncluded(x,
                                                                                                                 SchemaTypesViewModel.ExcludedSchemaTypeNames.ToList())).ToList();

            foreach (var operationImport in OperationImportsViewModel.OperationImports)
            {
                if (operationsToExclude.Any(x => x.Name == operationImport.Name))
                {
                    operationImport.IsSelected = false;
                }
            }
        }