@@ -10,21 +10,9 @@ namespace ToSic.Sxc.Web;
1010/// The apps will get it using `var page = GetService{ToSic.Sxc.Web.IPageService}()` or similar.
1111/// </summary>
1212[ Obsolete ]
13- internal class WebPageServiceObsolete : IPageService , INeedsExecutionContext
13+ internal class WebPageServiceObsolete ( Services . IPageService pageServiceImplementation )
14+ : IPageService , INeedsExecutionContext
1415{
15- private readonly Services . IPageService _pageServiceImplementation ;
16-
17- /// <summary>
18- /// This is the obsolete version of the PageService, which is needed to keep old Apps working which used this.
19- /// The apps will get it using `var page = GetService{ToSic.Sxc.Web.IPageService}()` or similar.
20- /// </summary>
21- /// <param name="pageServiceImplementation"></param>
22- public WebPageServiceObsolete ( Services . IPageService pageServiceImplementation )
23- {
24- throw new ( "The interface ToSic.Sxc.Web.IPageService has been replaced with ToSic.Sxc.Services.IPageService. Deprecated since v12, removed in v20." ) ;
25- _pageServiceImplementation = pageServiceImplementation ;
26- }
27-
2816 /// <summary>
2917 /// Forward execution context to the actual implementation.
3018 ///
@@ -33,80 +21,80 @@ public WebPageServiceObsolete(Services.IPageService pageServiceImplementation)
3321 /// <param name="exCtx"></param>
3422 public void ConnectToRoot ( IExecutionContext exCtx )
3523 {
36- ( _pageServiceImplementation as INeedsExecutionContext ) ? . ConnectToRoot ( exCtx ) ;
24+ ( pageServiceImplementation as INeedsExecutionContext ) ? . ConnectToRoot ( exCtx ) ;
3725 }
3826
3927 public string SetBase ( string url = null )
4028 {
41- return _pageServiceImplementation . SetBase ( url ) ;
29+ return pageServiceImplementation . SetBase ( url ) ;
4230 }
4331
4432 public string SetTitle ( string value , string placeholder = null )
4533 {
46- return _pageServiceImplementation . SetTitle ( value , placeholder ) ;
34+ return pageServiceImplementation . SetTitle ( value , placeholder ) ;
4735 }
4836
4937 public string SetDescription ( string value , string placeholder = null )
5038 {
51- return _pageServiceImplementation . SetDescription ( value , placeholder ) ;
39+ return pageServiceImplementation . SetDescription ( value , placeholder ) ;
5240 }
5341
5442 public string SetKeywords ( string value , string placeholder = null )
5543 {
56- return _pageServiceImplementation . SetKeywords ( value , placeholder ) ;
44+ return pageServiceImplementation . SetKeywords ( value , placeholder ) ;
5745 }
5846
5947 public string SetHttpStatus ( int statusCode , string message = null )
6048 {
61- return _pageServiceImplementation . SetHttpStatus ( statusCode , message ) ;
49+ return pageServiceImplementation . SetHttpStatus ( statusCode , message ) ;
6250 }
6351
6452 public string AddToHead ( string tag )
6553 {
66- return _pageServiceImplementation . AddToHead ( tag ) ;
54+ return pageServiceImplementation . AddToHead ( tag ) ;
6755 }
6856
6957 public string AddToHead ( IHtmlTag tag )
7058 {
71- return _pageServiceImplementation . AddToHead ( tag ) ;
59+ return pageServiceImplementation . AddToHead ( tag ) ;
7260 }
7361
7462 public string AddMeta ( string name , string content )
7563 {
76- return _pageServiceImplementation . AddMeta ( name , content ) ;
64+ return pageServiceImplementation . AddMeta ( name , content ) ;
7765 }
7866
7967 public string AddOpenGraph ( string property , string content )
8068 {
81- return _pageServiceImplementation . AddOpenGraph ( property , content ) ;
69+ return pageServiceImplementation . AddOpenGraph ( property , content ) ;
8270 }
8371
8472 public string AddJsonLd ( string jsonString )
8573 {
86- return _pageServiceImplementation . AddJsonLd ( jsonString ) ;
74+ return pageServiceImplementation . AddJsonLd ( jsonString ) ;
8775 }
8876
8977 public string AddJsonLd ( object jsonObject )
9078 {
91- return _pageServiceImplementation . AddJsonLd ( jsonObject ) ;
79+ return pageServiceImplementation . AddJsonLd ( jsonObject ) ;
9280 }
9381
9482 public string AddIcon ( string path , NoParamOrder noParamOrder = default , string rel = "" , int size = 0 ,
9583 string type = null )
9684 {
97- return _pageServiceImplementation . AddIcon ( path , noParamOrder , rel , size , type ) ;
85+ return pageServiceImplementation . AddIcon ( path , noParamOrder , rel , size , type ) ;
9886 }
9987
10088 public string AddIconSet ( string path , NoParamOrder noParamOrder = default , object favicon = null ,
10189 IEnumerable < string > rels = null ,
10290 IEnumerable < int > sizes = null )
10391 {
104- return _pageServiceImplementation . AddIconSet ( path , noParamOrder , favicon , rels , sizes ) ;
92+ return pageServiceImplementation . AddIconSet ( path , noParamOrder , favicon , rels , sizes ) ;
10593 }
10694
10795 public string Activate ( params string [ ] keys )
10896 {
109- return _pageServiceImplementation . Activate ( keys ) ;
97+ return pageServiceImplementation . Activate ( keys ) ;
11098 }
11199
112100}
0 commit comments