Repository navigation
Code clean up round 2 - #776
Merged
Merged
Conversation
Aligns folder name with csproj (DasBlog.Core.csproj) and namespaces (DasBlog.Core.*). Updates solution, csproj refs, and Dockerfile.
This folder had no .csproj file, was not referenced by any project, and was not included in the solution. Its Security and XmlRpc classes were duplicates of code already in DasBlog.Services and DasBlog.Core.
- Veriifier.cs → Verifier.cs (class name also fixed) - UrlInfocs.cs → UrlInfo.cs (filename only, class was already correct)
Move IDasBlogSettings, IUrlResolver, ITimeZoneService, IContentProcessor, IMailProvider, and IUserManager into DasBlog.Services/Interfaces/ for consistent organization matching the pattern in DasBlog.Managers.
Replace all Newtonsoft.Json usage with System.Text.Json across 6 files: - WebManifest.cs: JsonProperty → JsonPropertyName, NullValueHandling → JsonIgnore(WhenWritingNull), JsonConvert → JsonSerializer - OEmbed.cs: JsonProperty → JsonPropertyName - ExternalEmbeddingHandler.cs: JsonConvert.DeserializeObject → JsonSerializer.Deserialize - OEmbedProvidersFileService.cs: Newtonsoft JsonSerializer → System.Text.Json - PostViewModel.cs, StaticPageViewModel.cs: removed unused Newtonsoft using Remove Newtonsoft.Json from DasBlog.Services.csproj and Directory.Packages.props. One fewer third-party dependency.
…aryManager Add 3 new test files and extend existing SiteSecurityManagerTest: - CommentManagerTest: constructor, GetComments, GetAllComments, DeleteComment (valid/invalid), ApproveComment - SearchManagerTest: constructor, empty search returns all, matching term returns matches - FileSystemBinaryManagerTest: constructor with full mock setup - SiteSecurityManagerTest: added VerifyHashedPassword tests Test count: 139 → 151 (12 new tests, all passing)
- Remove duplicate static file registration for binaries path (exact duplicate block, lines 358-363) - Remove redundant IHttpContextAccessor singleton registration (already registered via AddHttpContextAccessor() on line 192)
…vices Add ILogger injection to MetaConfigFileService, SiteConfigFileService, OEmbedProvidersFileService, and SiteSecurityConfigFileService. Replace '// TODO log' + Console.WriteLine(e) with structured logger.LogError() calls including the file path context.
…hods Create DasBlogServiceCollectionExtensions with three focused methods: - AddDasBlogDataServices(): IBlogDataService, ILoggingDataService factories - AddDasBlogManagers(): all 11 manager singletons - AddDasBlogServices(): core services, config file services, transients Reduces Startup.cs from 525 to 481 lines and makes the DI registration structure clear and navigable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Classification
Code cleanup and modernization to remove Newtonsoft.Json, streamline dependencies, and improve test coverage.
PR Summary
This pull request replaces Newtonsoft.Json with System.Text.Json, removes obsolete XML-RPC and authentication code, and refactors dependency injection for maintainability.