London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

SiteDefinition.Current.StartPage vs ContentReference.StartPage

Vote:
 

Hi,

Is there a difference between these 2? If so which one should I use?

#119150
Mar 22, 2015 20:41
Vote:
 

I don't think there are any differens, but I would use the site definition one.

I must check the code to verify how they work (maby someone else will do it before me)

#119152
Mar 23, 2015 8:11
Vote:
 

Hi

There is no difference in the functionality (I just did check the code:)). ContentReference.StartPage uses the SiteDefinition. One benefit of SiteDefinition (but not SiteDefinition.Current) is that it can be used as a service in dependency injection, so you would not need any static access that could be a problem when writing unit tests.

Regards

Per Gunsarfs

#119156
Mar 23, 2015 9:24
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.