Which is the best way to reference current site/web in sharepoint specially for Timer Jobs from the examples given below and why?
Example1: SPWebApplication webApp = this.Parent as SPWebApplication; SPWeb oWeb = webApp.Sites[0].RootWeb;
OR
Example2: using(SPSite site=new SPSite(SPCOntext.Current.Web.Url)){ using(SPWeb web=site.OpenWeb()){
} }