public Task <bool> RemoveOrder() { if (!_order.State.Exists) { throw new OrderDoesNotExistsException(); } _order.State = new Order(); // resets timestamp _order.ClearStateAsync(); this.DeactivateOnIdle(); //Deactive the grain. return(Task.FromResult(true)); }
public async Task removeData() { _note.State.finished = false; _note.State.noteDate = ""; _note.State.noteText = ""; await _note.ClearStateAsync(); }
private Task ResetAsync() { // clear and publish the state _state.State.Tag = Guid.Empty; _state.State.Value = null; _state.State.AbsoluteExpiration = null; _state.State.SlidingExpiration = null; Publish(); // attempt to remove stored state as well return(Task.WhenAll(_state.ClearStateAsync(), _flags.ClearStateAsync())); }
public async Task RemoveUser() { if (!_user.State.Exists) { throw new UserDoesNotExistsException(); } //Remove user from database. await _user.ClearStateAsync(); this.DeactivateOnIdle(); }
public async Task <IdentityResult> Delete() { if (_data.State.Role == null) { return(IdentityResult.Failed()); } await GrainFactory.RemoveFromLookup(OrleansIdentityConstants.RoleLookup, _data.State.Role.NormalizedName); await Task.WhenAll(_data.State.Users.Select(u => GrainFactory.GetGrain <IIdentityUserGrain <TUser, TRole> >(u).RemoveRole(_id, false))); await _data.ClearStateAsync(); return(IdentityResult.Success); }
public async Task CheckAsync() { try { state.State = Guid.NewGuid(); await state.WriteStateAsync(); await state.ReadStateAsync(); await state.ClearStateAsync(); } finally { DeactivateOnIdle(); } }
public async Task <IdentityResult> Delete() { if (_data.State.User == null) { return(IdentityResult.Failed(_errorDescriber.DefaultError())); } await GrainFactory.RemoveFromLookup(OrleansIdentityConstants.EmailLookup, _data.State.User.NormalizedEmail); await GrainFactory.RemoveFromLookup(OrleansIdentityConstants.UsernameLookup, _data.State.User.NormalizedUserName); await Task.WhenAll(_data.State.Roles.Select(r => GrainFactory.GetGrain <IIdentityRoleGrain <TUser, TRole> >(r).RemoveUser(_id))); await _data.ClearStateAsync(); return(IdentityResult.Success); }
public async Task CheckAsync() { try { State.State = new StorageHealthCheckState { Id = Guid.NewGuid().ToString() }; await State.WriteStateAsync(); await State.ReadStateAsync(); await State.ClearStateAsync(); } finally { DeactivateOnIdle(); } }
public async Task OnDisconnect(string?reason = null) { _logger.LogDebug("Disconnecting connection on {hubName} for connection {connectionId} from server {serverId} via {reason}", _keyData.HubName, _keyData.Id, _clientState.State.ServerId, reason); if (_keyData.Id != null) { await _clientDisconnectStream.OnNextAsync(_keyData.Id); } await _clientState.ClearStateAsync(); if (_serverDisconnectedSubscription != null) { await _serverDisconnectedSubscription.UnsubscribeAsync(); } DeactivateOnIdle(); }
public async Task Clear() { await _stock.ClearStateAsync(); }
public async Task EraseHistory() { DeactivateOnIdle(); await _conversationState.ClearStateAsync(); }
public Task Remove() { DeactivateOnIdle(); return(_data.ClearStateAsync()); }
public HelloArchiveGrain([PersistentState("archive", GrainConst.Storage)] IPersistentState <GreetingArchive> archive) { _archive = archive; try { _archive.ClearStateAsync().Wait(); } catch { } }
public async Task CleanInformationAsync() { DeactivateOnIdle(); await _state.ClearStateAsync(); }