Extension methods for obtaining ContentReference from LinkItem and Url

(for EPiServer 8+)

…two simplified methods to cover LinkItem and Url:

public static ContentReference ToContentReference(this LinkItem linkItem)
        {
            if (linkItem == null)
                return ContentReference.EmptyReference;

            var content = UrlResolver.Current.Route(new UrlBuilder(linkItem.Href));
            return content != null ? content.ContentLink : ContentReference.EmptyReference;
        }

And

public static ContentReference ToContentReference(this Url url)
        {
            if (url == null)
                return ContentReference.EmptyReference;

            var content = UrlResolver.Current.Route(new UrlBuilder(url));
            return content != null ? content.ContentLink : ContentReference.EmptyReference;
        }

Source: Safest method of obtaining ContentReference from LinkItem

EPiServer CMS 11 reset search index url (EPiServe built in search)

(By THACH Lockevn, 1/4/2018 9:46:19 AM) To reset the search index, admin goes to IndexContent.aspx In CMS 11, IndexContent.aspx is included in the new EPiServer.Search.Cms package The URL has changed from /EPiServer/CMS/Admin/IndexContent.aspx  to /EPiServer/EPiServer.Search.Cms/IndexContent.aspx

Source: Breaking changes (CMS 11)

asp.net mvc – razor views are not giving compile time error – Stack Overflow

Razor views are dynamically compiled by the ASP.NET runtime. If you want your views to be built at compile-time you could add the following option to your .csproj file:
<PropertyGroup>
<MvcBuildViews>true</MvcBuildViews>
</PropertyGroup>

You may take a look at the this article for more details.

Source: asp.net mvc – razor views are not giving compile time error – Stack Overflow

The Onion Architecture : part 1 : Jeffrey Palermo (.com)

I’ve spoken several times about a specific type of architecture I call “Onion Architecture”. I’ve found that it leads to more maintainable applications since it emphasizes separation of concerns throughout the system. I must set the context for the use of this architecture before proceeding. This architecture is not appropriate for small websites. It is appropriate for long-lived business applications as well as applications with complex behavior. It emphasizes the use of interfaces for behavior contracts, and it forces the externalization of infrastructure.
jeffreypalermo.com/blog/the-onion-architecture-part-1/

PermanentLinkMapStore.TryToMapped and PermanentLinkUtility.GetContentReference not working after EPiServer 9 Upgrade

Upgrading EPiServer 8 to 9 might result in this warning:

Warning CS0618 ‘PermanentLinkMapStore.TryToMapped(string, out string)’ is obsolete: ‘This method only supports classic/mapped url’s which are no longer used since 8.0 – use PermanentLinkUtility.GetGuid(url) to get the unique ID from an URL’

How to solve warning:

You can try:

EPiServer.Web.Routing.UrlResolver.Current.GetPermanent();

or

EPiServer.Web.Routing.UrlResolver.Current.TryToPermanent();

to get a permanent link

 

See more info here: PermanentLinkMapStore.TryToMapped and PermanentLinkUtility.GetContentReference not working after EPiServer 9 Upgrade