コード例 #1
0
        // Delete the attribute group with the specified attribute group id.
        private static void DeleteAttributeGroup(Guid attributeGroupId)
        {
            try
            {
                // Create the request object for attribute group deletion.
                MetadataDeleteRequest deleteRequest = new MetadataDeleteRequest();
                deleteRequest.Metadata = new Metadata();
                deleteRequest.Metadata.AttributeGroups = new System.Collections.ObjectModel.Collection <AttributeGroup> {
                };
                AttributeGroup anAttributeGroup = new AttributeGroup();
                // Set attribute group id.
                anAttributeGroup.Identifier = new MemberTypeContextIdentifier {
                    Id = attributeGroupId
                };
                deleteRequest.Metadata.AttributeGroups.Add(anAttributeGroup);

                // Delete the specified attribute group.
                MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

                HandleOperationErrors(deleteResponse.OperationResult);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }
        }
コード例 #2
0
        // Delete the entity with the specified entity id.
        private static void DeleteEntity(Guid entityId)
        {
            try
            {
                // Create the request object for entity deletion.
                MetadataDeleteRequest deleteRequest = new MetadataDeleteRequest();
                deleteRequest.Metadata          = new Metadata();
                deleteRequest.Metadata.Entities = new System.Collections.ObjectModel.Collection <Entity> {
                };
                Entity anEntity = new Entity();
                anEntity.Identifier = new ModelContextIdentifier {
                    Id = entityId
                };
                deleteRequest.Metadata.Entities.Add(anEntity);

                // Delete the specified entity
                MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

                HandleOperationErrors(deleteResponse.OperationResult);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }
        }
コード例 #3
0
        // Delete the model with the specified model id.
        private static void DeleteModel(Guid modelId)
        {
            try
            {
                // Create the request object for model deletion.
                MetadataDeleteRequest deleteRequest = new MetadataDeleteRequest();
                deleteRequest.Metadata        = new Metadata();
                deleteRequest.Metadata.Models = new System.Collections.ObjectModel.Collection <Model> {
                };
                Model newModel = new Model();
                newModel.Identifier = new Identifier {
                    Id = modelId
                };
                deleteRequest.Metadata.Models.Add(newModel);

                // Delete the specified model
                MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

                HandleOperationErrors(deleteResponse.OperationResult);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }
        }
コード例 #4
0
        public BasicResponse DeleteMetadata(MetadataDeleteRequest metadatarequest)
        {
            _Repository.DeleteMetadata(metadatarequest.Id);
            var metadataresponse = new BasicResponse();

            return(metadataresponse);
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: NadirTP/tpGit
        private static void DeleteModel(Identifier modelId)
        {
            MetadataDeleteRequest deleteRequest =
                new MetadataDeleteRequest
            {
                Metadata = new Metadata
                {
                    Models = new Collection <Model>
                    {
                        new Model
                        {
                            Identifier = modelId
                        }
                    }
                }
            };
            MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

            HandleOperationErrors(deleteResponse.OperationResult);
        }
コード例 #6
0
        // Delete the model with the specified model id.
        private static void DeleteModel(Guid modelId)
        {
            try
            {
                // Create the request object for model deletion.
                MetadataDeleteRequest deleteRequest = new MetadataDeleteRequest();
                deleteRequest.Metadata = new Metadata();
                deleteRequest.Metadata.Models = new System.Collections.ObjectModel.Collection<Model> { };
                Model newModel = new Model();
                newModel.Identifier = new Identifier { Id = modelId };
                deleteRequest.Metadata.Models.Add(newModel);

                // Delete the specified model
                MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

                HandleOperationErrors(deleteResponse.OperationResult);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }
        }
コード例 #7
0
        // Delete the entity with the specified entity id.
        private static void DeleteEntity(Guid entityId)
        {
            try
            {
                // Create the request object for entity deletion.
                MetadataDeleteRequest deleteRequest = new MetadataDeleteRequest();
                deleteRequest.Metadata = new Metadata();
                deleteRequest.Metadata.Entities = new System.Collections.ObjectModel.Collection<Entity> { };
                Entity anEntity = new Entity();
                anEntity.Identifier = new ModelContextIdentifier { Id = entityId };
                deleteRequest.Metadata.Entities.Add(anEntity);

                // Delete the specified entity
                MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

                HandleOperationErrors(deleteResponse.OperationResult);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }
        }
コード例 #8
0
        // Delete the attribute group with the specified attribute group id.
        private static void DeleteAttributeGroup(Guid attributeGroupId)
        {
            try
            {
                // Create the request object for attribute group deletion.
                MetadataDeleteRequest deleteRequest = new MetadataDeleteRequest();
                deleteRequest.Metadata = new Metadata();
                deleteRequest.Metadata.AttributeGroups = new System.Collections.ObjectModel.Collection<AttributeGroup> { };
                AttributeGroup anAttributeGroup = new AttributeGroup();
                // Set attribute group id.
                anAttributeGroup.Identifier = new MemberTypeContextIdentifier { Id = attributeGroupId };
                deleteRequest.Metadata.AttributeGroups.Add(anAttributeGroup);

                // Delete the specified attribute group.
                MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);

                HandleOperationErrors(deleteResponse.OperationResult);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }
        }
コード例 #9
0
 private static void DeleteModel(Identifier modelId)
 {
     MetadataDeleteRequest deleteRequest =
         new MetadataDeleteRequest
         {
             Metadata = new Metadata
             {
                 Models = new Collection<Model>
                 {
                     new Model
                     {
                         Identifier = modelId
                     }
                 }
             }
         };
     MetadataDeleteResponse deleteResponse = clientProxy.MetadataDelete(deleteRequest);
     HandleOperationErrors(deleteResponse.OperationResult);
 }