コード例 #1
0
        public IContent GetSingleton(string id)
        {
            var contentType = ContentTypeProvider.Get(id);

            var singleton = SingletonProvider.Get(id);

            return(ContainerSpecificContentGetter.Get <IContent>(singleton.Id, null, contentType.Container));
        }
コード例 #2
0
        public string GetUrl(string id, string contentTypeId)
        {
            var contentType = ContentTypeProvider.Get(contentTypeId);

            var content = ContainerSpecificContentGetter.Get <IContent>(id, null, contentType.Container);

            return(UrlProvider.Get(content));
        }
コード例 #3
0
        public async Task <Item> Get(string type, string value)
        {
            var contentType = ContentTypeProvider.Get(type);
            var content     = await ContainerSpecificContentGetter.GetAsync <IContent>(value, null, contentType.Container).ConfigureAwait(false);

            if (content == null)
            {
                return(null);
            }

            return(new Item((content as INameable)?.Name ?? content.Id, null, content.Id, (content as IImageable)?.Image));
        }
コード例 #4
0
 public async Task <User> FindByIdAsync(string userId, CancellationToken cancellationToken)
 {
     return(await ContainerSpecificContentGetter.GetAsync <User>(userId, null, Container));
 }