Exemple #1
0
        /// <summary>
        ///     creates the apicall object needed to activate the request
        /// </summary>
        /// <returns></returns>
        protected virtual ApiCall Create()
        {
            if (HostAdress != null && CurrentConfiguration.Host == null)
            {
                CurrentConfiguration.Host = HostAdress;
            }

            var call = CurrentConfiguration.CreateCall();

            ResetCurrentConfiguration();
            return(call);
        }
Exemple #2
0
        /// <summary>
        ///     creates the apicall object needed to activate the request
        /// </summary>
        /// <typeparam name="T"> response will be cast to this type</typeparam>
        /// <returns></returns>
        protected virtual ApiCall <T> Create <T>()
        {
            if (HostAdress != null && CurrentConfiguration.Host == null)
            {
                CurrentConfiguration.Host = HostAdress;
            }

            if (IdentityProvider != null)
            {
                CurrentConfiguration.Identity = IdentityProvider;
            }

            var call = CurrentConfiguration.CreateCall <T>();

            ResetCurrentConfiguration();
            return(call);
        }
Exemple #3
0
        protected ApiCall <T> Create()
        {
            if (HostAdress != null && CurrentConfiguration.Host == null)
            {
                CurrentConfiguration.Host = HostAdress;
            }

            var call = CurrentConfiguration.CreateCall <T>();

            ResetCurrentConfiguration();

            call.OnSuccess((args) =>
            {
                if (args.HasContent)
                {
                    _trackedEntities.TrackExternalEntity(args.Content);
                }
            });

            return(call);
        }
Exemple #4
0
        protected ApiCall <List <T> > CreateBulkCall()
        {
            if (HostAdress != null && CurrentConfiguration.Host == null)
            {
                CurrentConfiguration.Host = HostAdress;
            }

            var call = CurrentConfiguration.CreateCall <List <T> >();

            ResetCurrentConfiguration();

            call.OnSuccess((args) =>
            {
                if (!args.HasContent)
                {
                    return;
                }

                args.Content.ForEach(item => _trackedEntities.TrackExternalEntity(item));
            });

            return(call);
        }