예제 #1
0
        public async Task <IContentEntity> FindContentAsync(Guid schemaId, Guid id)
        {
            var content = cachedContents.GetOrDefault(id);

            if (content == null)
            {
                content = await contentQuery.FindContentAsync(context.WithSchemaId(schemaId), id);

                if (content != null)
                {
                    cachedContents[content.Id] = content;
                }
            }

            return(content);
        }
예제 #2
0
        public async Task Should_return_schema_from_id_if_string_is_guid()
        {
            A.CallTo(() => appProvider.GetSchemaAsync(appId, schemaId, false))
            .Returns(schema);

            var result = await sut.GetSchemaAsync(context.WithSchemaId(schemaId));

            Assert.Equal(schema, result);
        }