public object GetContentTypeAliasByGuid([FromQuery] Guid guid) { return(new { alias = _contentTypeService.GetAllContentTypeAliases(guid).FirstOrDefault() }); }
private int?CreateContent(Item item, int parentId, int userId = 0) { var contentTypes = _contentTypeService.GetAllContentTypeAliases(); var contentType = contentTypes.FirstOrDefault(x => item.NodeType.Ref.Replace(" ", "").ToLower().Contains(x.ToLower())); var content = _contentService.CreateContent(item.Name, parentId, contentType, userId); return(content.Id); }
private string GetContentTypeAliasByGuid(Guid contentTypeGuid) { return((string)_appCaches.RuntimeCache.GetCacheItem( string.Concat("Our.Umbraco.DocTypeGridEditor.Helpers.DocTypeGridEditorHelper.GetContentTypeAliasByGuid_", contentTypeGuid), () => _contentTypeService.GetAllContentTypeAliases(contentTypeGuid).FirstOrDefault())); }