public async Task <Result <Unit, Error> > Persist(Name name, ProcessingConfiguration configuration) { _cache.AddOrUpdate(name, configuration, (_, __) => configuration); var result = await _repository.Persist(name, configuration); result.IfSuccess(_ => _cache.TryRemove(name, out var _)); return(result); }
public Task <Result <Unit, Error> > Persist(Name name, ProcessingConfiguration configuration) { return(Task.FromResult(Result.Failure <Unit, Error>(ErrorCode.NotSupported))); }