Example #1
0
        internal async Task <TQuery> Get <TQuery>(Id id) where TQuery : Query
        {
            var key = GetKey <TQuery>(id);

            var state = await _queryDb.ReadState(QueryETag.From(key));

            return((TQuery)Deserialize(key.Type, state.ReadContent()));
        }
Example #2
0
        public async Task <IActionResult> Get(Type type, Id id)
        {
            var etag = ReadETag(type, id);

            var state = await _db.ReadState(etag);

            return(state.NotModified
        ? new QueryNotModifiedResult(etag)
        : new QueryStateResult(state) as IActionResult);
        }