diff --git a/.codacy.yml b/.codacy.yml index be01c73..1282d2f 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -5,30 +5,31 @@ exclude_paths: # Ignore all root-level metadata and documentation - - '.gitignore' # root Git ignore file - - '.runsettings' # root runsettings file - - 'LICENSE' # root license file - - 'README.md' # root readme + - '.gitignore' + - '.runsettings' + - 'LICENSE' + - 'README.md' # Ignore all file types that shouldn't be analyzed - - '**.yml' # YAML files anywhere (build, config, pipelines) - - '**.json' # JSON files (settings, config) - - '**.png' # Images, e.g., Swagger diagram - - '**.sln' # Solution files - - '**.csproj' # C# project files + - '**.yml' + - '**.json' + - '**.png' + - '**.sln' + - '**.csproj' # Ignore generated or infrastructure files - - '**/*Program.cs' # Main entry point, often not useful for static analysis + - '**/*Program.cs' # Ignore specific folders across any depth in the project - - '**/Configurations/**' # Swagger options, etc - - '**/Data/**' # Repositories, DbContext, database file, etc. - - '**/Enums/**' # Enumeration types - - '**/Mappings/**' # AutoMapper profiles - - '**/Migrations/**' # EF Core migration snapshots - - '**/Models/**' # Domain and DTO models - - '**/Properties/**' # launchSettings.json or AssemblyInfo.cs - - '**/Utilities/**' # Helper extensions or static classes - - '**/Validators/**' # FluentValidation validators - - 'test/**/*' # Entire test suite (unit + integration) - - 'scripts/**/*' # Helper shell scripts + - '**/Configurations/**' + - '**/Data/**' + - '**/Enums/**' + - '**/Mappings/**' + - '**/Migrations/**' + - '**/Models/**' + - '**/Properties/**' + - '**/Repositories/**' + - '**/Utilities/**' + - '**/Validators/**' + - 'test/**/*' + - 'scripts/**/*' diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 65baf5d..7cda12e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -24,18 +24,6 @@ "/consoleloggerparameters:NoSummary;ForceNoAlign" ], "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "--project", - "${workspaceFolder}/Dotnet.Samples.AspNetCore.WebApi.sln" - ], - "problemMatcher": "$msCompile" } ] } diff --git a/codecov.yml b/codecov.yml index d7ac00c..7caf554 100644 --- a/codecov.yml +++ b/codecov.yml @@ -62,5 +62,6 @@ ignore: - .*\/Migrations\/.* - .*\/Models\/.* - .*\/Properties\/.* + - .*\/Repositories\/.* - .*\/Utilities\/.* - .*\/Validators\/.* diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Program.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Program.cs index df8376a..d3bffcb 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Program.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Program.cs @@ -2,6 +2,7 @@ using Dotnet.Samples.AspNetCore.WebApi.Data; using Dotnet.Samples.AspNetCore.WebApi.Mappings; using Dotnet.Samples.AspNetCore.WebApi.Models; +using Dotnet.Samples.AspNetCore.WebApi.Repositories; using Dotnet.Samples.AspNetCore.WebApi.Services; using Dotnet.Samples.AspNetCore.WebApi.Validators; using FluentValidation; diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Properties/launchSettings.json b/src/Dotnet.Samples.AspNetCore.WebApi/Properties/launchSettings.json deleted file mode 100644 index 7754d05..0000000 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Properties/launchSettings.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:6263", - "sslPort": 44325 - } - }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "http://localhost:5039", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7135;http://localhost:5039", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Data/IPlayerRepository.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/IPlayerRepository.cs similarity index 92% rename from src/Dotnet.Samples.AspNetCore.WebApi/Data/IPlayerRepository.cs rename to src/Dotnet.Samples.AspNetCore.WebApi/Repositories/IPlayerRepository.cs index 29a4131..b082c00 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Data/IPlayerRepository.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/IPlayerRepository.cs @@ -2,7 +2,7 @@ using Dotnet.Samples.AspNetCore.WebApi.Models; -namespace Dotnet.Samples.AspNetCore.WebApi.Data; +namespace Dotnet.Samples.AspNetCore.WebApi.Repositories; /// /// Provides specialized repository operations for Player entities. diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Data/IRepository.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/IRepository.cs similarity index 96% rename from src/Dotnet.Samples.AspNetCore.WebApi/Data/IRepository.cs rename to src/Dotnet.Samples.AspNetCore.WebApi/Repositories/IRepository.cs index 9924b37..b65da42 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Data/IRepository.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/IRepository.cs @@ -1,4 +1,4 @@ -namespace Dotnet.Samples.AspNetCore.WebApi.Data; +namespace Dotnet.Samples.AspNetCore.WebApi.Repositories; /// /// Provides generic repository operations for entities of type . diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerRepository.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/PlayerRepository.cs similarity index 83% rename from src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerRepository.cs rename to src/Dotnet.Samples.AspNetCore.WebApi/Repositories/PlayerRepository.cs index f80a724..2863e77 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Data/PlayerRepository.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/PlayerRepository.cs @@ -1,7 +1,8 @@ +using Dotnet.Samples.AspNetCore.WebApi.Data; using Dotnet.Samples.AspNetCore.WebApi.Models; using Microsoft.EntityFrameworkCore; -namespace Dotnet.Samples.AspNetCore.WebApi.Data; +namespace Dotnet.Samples.AspNetCore.WebApi.Repositories; public sealed class PlayerRepository(PlayerDbContext dbContext) : Repository(dbContext), diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Data/Repository.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/Repository.cs similarity index 93% rename from src/Dotnet.Samples.AspNetCore.WebApi/Data/Repository.cs rename to src/Dotnet.Samples.AspNetCore.WebApi/Repositories/Repository.cs index 330f273..10d4d25 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Data/Repository.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Repositories/Repository.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Dotnet.Samples.AspNetCore.WebApi.Data; +namespace Dotnet.Samples.AspNetCore.WebApi.Repositories; public class Repository(DbContext dbContext) : IRepository where T : class diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Services/PlayerService.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Services/PlayerService.cs index ea446e8..bd3ed54 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Services/PlayerService.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Services/PlayerService.cs @@ -1,6 +1,6 @@ using AutoMapper; -using Dotnet.Samples.AspNetCore.WebApi.Data; using Dotnet.Samples.AspNetCore.WebApi.Models; +using Dotnet.Samples.AspNetCore.WebApi.Repositories; using Microsoft.Extensions.Caching.Memory; namespace Dotnet.Samples.AspNetCore.WebApi.Services; diff --git a/src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs b/src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs index b107df4..46949cd 100644 --- a/src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs +++ b/src/Dotnet.Samples.AspNetCore.WebApi/Validators/PlayerRequestModelValidator.cs @@ -1,6 +1,6 @@ -using Dotnet.Samples.AspNetCore.WebApi.Data; using Dotnet.Samples.AspNetCore.WebApi.Enums; using Dotnet.Samples.AspNetCore.WebApi.Models; +using Dotnet.Samples.AspNetCore.WebApi.Repositories; using FluentValidation; namespace Dotnet.Samples.AspNetCore.WebApi.Validators; diff --git a/test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs b/test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs index 091a319..4b82f54 100644 --- a/test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs +++ b/test/Dotnet.Samples.AspNetCore.WebApi.Tests/Utilities/PlayerMocks.cs @@ -1,7 +1,7 @@ using AutoMapper; using Dotnet.Samples.AspNetCore.WebApi.Controllers; -using Dotnet.Samples.AspNetCore.WebApi.Data; using Dotnet.Samples.AspNetCore.WebApi.Models; +using Dotnet.Samples.AspNetCore.WebApi.Repositories; using Dotnet.Samples.AspNetCore.WebApi.Services; using FluentValidation; using Microsoft.AspNetCore.Mvc;