Пример #1
0
        public async Task <IPlatformResponse <IMessageResponse> > DeleteTag(TagEntities entityType, Guid entityId, string tag, CancellationToken?cancellationToken = null, IProgress <ISDKProgress> progress = null)
        {
            var tokenP = IssueNewTokenAndProgressContainer(cancellationToken, progress);

            if ((await Login(Authorization, cancellationToken, progress)).Success)
            {
                return(await _clientBuilder.Request <IMessageResponse>(ApiEndpoint.Api, $"v2/{entityType}/{entityId}/tags/{WebUtility.UrlEncode(tag)}", tokenP.CancellationToken, tokenP.Progress, HttpMethod.Delete));
            }
            _log.Fatal(new Exception("Authorization Failed"));
            return(await Task.FromResult <IPlatformResponse <IMessageResponse> >(null));
        }
        public void Add <T>([NotNull] T entity, [NotNull] Tags tag) where T : class, IEntity
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }
            if (tag == null)
            {
                throw new ArgumentNullException(nameof(tag));
            }

            var dataSource = _tagDataSourceProvider.Get(entity);

            var tagEntity = new TagEntities
            {
                EntityId = entity.Id,
                TableId  = dataSource.Id,
                TagId    = tag.Id
            };

            _tagEntityRepository.Insert(tagEntity);

            _tagEntityRepository.Save();
        }
Пример #3
0
 public async Task <IPlatformResponse <IMessageResponse> > DeleteTag(TagEntities entityType, Guid entityId, string tag, CancellationToken?cancellationToken = null, IProgress <ISDKProgress> progress = null)
 {
     SetupTokenAndProgress(cancellationToken, progress);
     return(await SdkClient.DeleteTag(entityType, entityId, tag, cancellationToken, progress));
 }