Exemplo n.º 1
0
        public async Task ReadStateAsync(string grainType, GrainReference grainReference, IGrainState grainState)
        {
            var primaryKey = grainReference.ToKeyString();

            try
            {
                var storedState = await _grainStateStore.GetGrainState(primaryKey, grainState.GetType());

                if (storedState != null)
                {
                    grainState.From(storedState);
                }
            }
            catch (Exception ex)
            {
                LogError("reading", ex, grainType, grainReference, primaryKey);
                throw;
            }
        }