/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.ChangesTracking = new ChangesTracking(this); this.BaseUri = new System.Uri("http://localhost/admin"); SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore, // ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore, // ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); }
/// <summary> /// Get last modified date for given scope /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <LastModifiedResponse> GetLastModifiedDateAsync(this IChangesTracking operations, string scope = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetLastModifiedDateWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get last modified date for given scope /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// </param> public static LastModifiedResponse GetLastModifiedDate(this IChangesTracking operations, string scope = default(string)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IChangesTracking)s).GetLastModifiedDateAsync(scope), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Force set changes last modified date /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='forceRequest'> /// Force changes request /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task ForceChangesAsync(this IChangesTracking operations, ForceChangesRequest forceRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.ForceChangesWithHttpMessagesAsync(forceRequest, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Force set changes last modified date /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='forceRequest'> /// Force changes request /// </param> public static void ForceChanges(this IChangesTracking operations, ForceChangesRequest forceRequest) { System.Threading.Tasks.Task.Factory.StartNew(s => ((IChangesTracking)s).ForceChangesAsync(forceRequest), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }