44using Microsoft . AspNetCore . Authorization ;
55using Microsoft . AspNetCore . Identity ;
66using Microsoft . AspNetCore . Mvc ;
7- using Microsoft . AspNetCore . Mvc . ViewEngines ;
87using System . Linq ;
98using System . Threading . Tasks ;
109using System . Xml ;
@@ -14,17 +13,13 @@ namespace App.Controllers
1413 [ ApiExplorerSettings ( IgnoreApi = true ) ]
1514 public class BlogController : Controller
1615 {
17- IDataService _db ;
1816 IFeedService _ss ;
1917 SignInManager < AppUser > _sm ;
20- private readonly ICompositeViewEngine _viewEngine ;
2118
22- public BlogController ( IDataService db , IFeedService ss , SignInManager < AppUser > sm , ICompositeViewEngine viewEngine )
19+ public BlogController ( IFeedService ss , SignInManager < AppUser > sm )
2320 {
24- _db = db ;
2521 _ss = ss ;
2622 _sm = sm ;
27- _viewEngine = viewEngine ;
2823 }
2924
3025 [ HttpGet ( "feed/{type}" ) ]
@@ -51,27 +46,6 @@ public async Task Rss(string type)
5146 }
5247 }
5348
54- [ HttpGet ( "error/{code:int}" ) ]
55- public async Task < IActionResult > Error ( int code )
56- {
57- var model = new PostModel ( ) ;
58-
59- model . Blog = await _db . CustomFields . GetBlogSettings ( ) ;
60- model . Blog . Cover = $ "{ Url . Content ( "~/" ) } { model . Blog . Cover } ";
61-
62- var viewName = $ "~/Views/Shared/Error.cshtml";
63- var result = _viewEngine . GetView ( "" , viewName , false ) ;
64-
65- if ( result . Success )
66- {
67- return View ( viewName , model ) ;
68- }
69- else
70- {
71- return View ( "~/Views/Shared/_Error.cshtml" , model ) ;
72- }
73- }
74-
7549 [ HttpGet ( "admin" ) ]
7650 [ Authorize ]
7751 public IActionResult Admin ( )
0 commit comments