Пример #1
0
        public async Task <IActionResult> Get(Type type, Id id)
        {
            var content = await _db.ReadQueryContent(GetETag(), type, id);

            return(content.NotModified
        ? new QueryNotModifiedResult(content.ETag)
        : new QueryContentResult(content) as IActionResult);
        }
Пример #2
0
        public static Task <QueryContent> ReadQueryContent(this IQueryDb db, string etag, Type type, Id id) =>
        db.ReadQueryContent(area =>
        {
            if (!string.IsNullOrWhiteSpace(etag))
            {
                return(QueryETag.From(etag, area));
            }

            var key = FlowKey.From(area.Queries[type], id);

            return(QueryETag.From(key, TimelinePosition.None));
        });