public Task <ResourceLock> GetResourceLockAsync(ResourceLock resourceLock, CancellationToken cancellationToken = default) { Preconditions.NotNull(resourceLock, nameof(resourceLock)); Preconditions.NotNull(resourceLock, $"{nameof(resourceLock)}.{nameof(resourceLock.Resource)}"); return(GetResourceLockAsync(resourceLock.Id, resourceLock.Resource.EntityId, resourceLock.Resource.EntityType, cancellationToken)); }
public Task <bool> UnlockResourceAsync(ResourceLock resourceLock, bool force, CancellationToken cancellationToken = default) { Preconditions.NotNull(resourceLock, nameof(resourceLock)); Preconditions.NotNull(resourceLock, $"{nameof(resourceLock)}.{nameof(resourceLock.Resource)}"); return(UnlockResourceAsync(resourceLock.Id, resourceLock.Resource.EntityId, resourceLock.Resource.EntityType, force, cancellationToken)); }
public Task <string> LockResourceAsync(string lockType, string resourceId, string resourceType, bool force, CancellationToken cancellationToken = default) { Preconditions.NotNullOrEmpty(lockType, nameof(lockType)); Preconditions.NotNullOrEmpty(resourceId, nameof(resourceId)); Preconditions.NotNullOrEmpty(resourceType, nameof(resourceType)); var resourceLock = new ResourceLock { LockType = lockType, Resource = new EntityReference(resourceId, resourceType) }; return(LockResourceAsync(resourceLock, force, false, cancellationToken)); }
public Task<string> LockResourceAsync(ResourceLock resourceLock, bool force, bool populate, CancellationToken cancellationToken = default) { Preconditions.NotNull(resourceLock, nameof(resourceLock)); var queryParameters = new QueryParameters(); if (force) { queryParameters.Add("force", "true"); } if (populate) { queryParameters.Add("view", "entity"); } return PostPopulateDirtyAsync(null, queryParameters.ToString(), nameof(LockResourceAsync), resourceLock, populate, cancellationToken); }
public Task <string> LockResourceAsync(ResourceLock resourceLock, bool force, CancellationToken cancellationToken = default) => LockResourceAsync(resourceLock, force, false, cancellationToken);
public Task <bool> UnlockResourceAsync(ResourceLock resourceLock, CancellationToken cancellationToken = default) => UnlockResourceAsync(resourceLock, false, cancellationToken);