public static string NodeTypeAlias(this IUwebshopEntity e) { if (e == null) { throw new ArgumentNullException("e"); } if (!string.IsNullOrEmpty(e.TypeAlias)) { return(e.TypeAlias); } // should never come beyond this line var p = e as uWebshopEntity; if (p != null && p.NodeTypeAlias != null) { return(p.NodeTypeAlias); } var entity = IO.Container.Resolve <ICMSEntityRepository>().GetByGlobalId(e.Id); if (entity != null && entity.NodeTypeAlias != null) { return(entity.NodeTypeAlias); } return(string.Empty); }
public static string GetUmbracoPath(this IUwebshopEntity entity) { var tryCast = entity as uWebshopEntity; if (tryCast != null) { return(tryCast.Path); } // todo: speed up return(IO.Container.Resolve <ICMSEntityRepository>().GetByGlobalId(entity.Id).Path); }
public static string GetDocTypeAlias(this IUwebshopEntity entity) { if (entity == null) { throw new ArgumentNullException("entity"); } if (!string.IsNullOrEmpty(entity.TypeAlias)) { return(entity.TypeAlias); } var tryCast = entity as uWebshopEntity; if (tryCast != null) { return(tryCast.NodeTypeAlias); } return(IO.Container.Resolve <ICMSEntityRepository>().GetByGlobalId(entity.Id).NodeTypeAlias); }