internal static IEnumerable <KeyValuePair <string, string> > ToParameters(this DataSetRemoveCriteria criteria)
        {
            var builder = new ParameterBuilder();

            builder.Add("startDate", criteria?.StartDate);
            builder.Add("endDate", criteria?.EndDate);

            if ((criteria?.Options & DataSetDeleteOptions.CascadeSessions).GetValueOrDefault() != 0)
            {
                builder.Add("cascade", "session");
            }
            if ((criteria?.Options & DataSetDeleteOptions.CascadeViews).GetValueOrDefault() != 0)
            {
                builder.Add("cascade", "view");
            }
            if ((criteria?.Options & DataSetDeleteOptions.CascadeModels).GetValueOrDefault() != 0)
            {
                builder.Add("cascade", "model");
            }
            if ((criteria?.Options & DataSetDeleteOptions.CascadeVocabularies).GetValueOrDefault() != 0)
            {
                builder.Add("cascade", "vocabulary");
            }

            return(builder.GetParameters());
        }
Example #2
0
        public async Task Remove(DataSetRemoveCriteria criteria, CancellationToken cancellationToken = default(CancellationToken))
        {
            Argument.IsNotNullOrEmpty(criteria.Name, nameof(criteria.Name));

            var parameters = criteria.ToParameters();
            await apiConnection.Delete($"data/{criteria.Name}", parameters, HttpMessageTransformer, CancellationToken.None).ConfigureAwait(false);
        }
Example #3
0
        public async Task Remove(DataSetRemoveCriteria criteria)
        {
            Argument.IsNotNullOrEmpty(criteria.Name, nameof(criteria.Name));

            var parameters = criteria.ToParameters();
            await Client.Delete($"{ApiKeys.Endpoint}data/{criteria.Name}", ApiKeys.ApiToken, parameters).ConfigureAwait(false);
        }
Example #4
0
 public async Task Remove(DataSetRemoveCriteria criteria)
 {
     try
     {
         DataSetRepository.Remove(criteria);
     }
     catch (Exception ex)
     {
         Logger.Error("DataSetService.Remove failed", this, ex);
     }
 }