// Delete an entity member with the member code. private static void DeleteEntityMember(string modelName, string versionName, string entityName, string memberCode, MemberType memType, string changesetName = null) { // Create the request object for entity member deletion. EntityMembersDeleteRequest deleteRequest = new EntityMembersDeleteRequest(); deleteRequest.Members = new EntityMembers(); // Set the modelName, the versionName, and the entityName. deleteRequest.Members.ModelId = new Identifier { Name = modelName }; deleteRequest.Members.VersionId = new Identifier { Name = versionName }; deleteRequest.Members.EntityId = new Identifier { Name = entityName }; deleteRequest.Members.MemberType = memType; deleteRequest.Members.Members = new Collection <Member> { }; Member aMember = new Member(); aMember.MemberId = new MemberIdentifier() { Code = memberCode, MemberType = memType }; deleteRequest.Members.Members.Add(aMember); if (!string.IsNullOrEmpty(changesetName)) { deleteRequest.Members.ChangesetId = new Identifier { Name = changesetName }; } // Delete the entity member. EntityMembersDeleteResponse createResponse = clientProxy.EntityMembersDelete(deleteRequest); HandleOperationErrors(createResponse.OperationResult); }
public EntityMembersDeleteResponse DeleteEntityMember(string modelName, string versionName, string entityName, string memberCode, MemberType memType, string changesetName = null) { // Create the request object for entity member deletion. EntityMembersDeleteRequest deleteRequest = new EntityMembersDeleteRequest(); deleteRequest.Members = new EntityMembers(); // Set the modelName, the versionName, and the entityName. deleteRequest.Members.ModelId = new Identifier { Name = modelName }; deleteRequest.Members.VersionId = new Identifier { Name = versionName }; deleteRequest.Members.EntityId = new Identifier { Name = entityName }; deleteRequest.Members.MemberType = memType; deleteRequest.Members.Members = new System.Collections.ObjectModel.Collection <Member> { }; Member aMember = new Member(); aMember.MemberId = new MemberIdentifier() { Code = memberCode, MemberType = memType }; deleteRequest.Members.Members.Add(aMember); if (!string.IsNullOrEmpty(changesetName)) { deleteRequest.Members.ChangesetId = new Identifier { Name = changesetName }; } // Delete the entity member. EntityMembersDeleteResponse deleteResponse = _clientProxy.EntityMembersDelete(deleteRequest); return(deleteResponse); }
// Delete an entity member with the member code. private static void DeleteEntityMember(string modelName, string versionName, string entityName, string memberCode, MemberType memType, string changesetName = null) { // Create the request object for entity member deletion. EntityMembersDeleteRequest deleteRequest = new EntityMembersDeleteRequest(); deleteRequest.Members = new EntityMembers(); // Set the modelName, the versionName, and the entityName. deleteRequest.Members.ModelId = new Identifier { Name = modelName }; deleteRequest.Members.VersionId = new Identifier { Name = versionName }; deleteRequest.Members.EntityId = new Identifier { Name = entityName }; deleteRequest.Members.MemberType = memType; deleteRequest.Members.Members = new Collection<Member> { }; Member aMember = new Member(); aMember.MemberId = new MemberIdentifier() { Code = memberCode, MemberType = memType }; deleteRequest.Members.Members.Add(aMember); if (!string.IsNullOrEmpty(changesetName)) { deleteRequest.Members.ChangesetId = new Identifier { Name = changesetName }; } // Delete the entity member. EntityMembersDeleteResponse createResponse = clientProxy.EntityMembersDelete(deleteRequest); HandleOperationErrors(createResponse.OperationResult); }