Skip to content

Conversation

@imhmdi
Copy link
Member

@imhmdi imhmdi commented May 20, 2025

No description provided.

@imhmdi imhmdi requested a review from Copilot May 20, 2025 19:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Applications.Abstractions project for result types and updates references and service registrations to use the new abstractions and consolidated extension methods.

  • Added Honamic.Framework.Applications.Abstractions project and wired it into solution and relevant csproj files
  • Updated namespaces from Honamic.Framework.Facade.Results to Honamic.Framework.Applications.Results across core and sample code
  • Centralized domain and event service registrations and updated application-level extensions to use them

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Facade/Default/Discovery/FacadeDiscovery.cs Switched result namespace to new Applications.Results
src/Facade/Abstractions/Honamic.Framework.Facade.Abstractions.csproj Added reference to Applications.Abstractions
src/Core/Events/Extensions/ServiceCollectionExtensions.cs Renamed AddDefaultEventssServicesAddDefaultEventsServices and updated registrations
src/Core/Domain/Extensions/ServiceCollectionExtensions.cs Added AddDefaultDomainsServices extension for domain services
src/Core/Applications/Honamic.Framework.Applications.csproj Referenced the new Applications.Abstractions project
src/Core/Applications/Extensions/ServiceCollectionExtensions.cs Updated AddDefaultApplicationsServices to call new domain/event extensions
src/Core/Applications.Abstractions/Results/ResultStatus.cs Updated namespace to Applications.Results
src/Core/Applications.Abstractions/Results/ResultMessagesExtensions.cs Updated namespace to Applications.Results
src/Core/Applications.Abstractions/Results/ResultMessage.cs Updated namespace to Applications.Results
src/Core/Applications.Abstractions/Results/Result.cs Updated namespace to Applications.Results
src/Core/Applications.Abstractions/Results/HttpStatusCodes.cs Updated namespace to Applications.Results
src/Core/Applications.Abstractions/Honamic.Framework.Applications.Abstractions.csproj New project file for result abstractions
TodoSample/Facade/TodoItems/TodoItemQueryFacade.cs Updated result namespace import
TodoSample/Facade/TodoItems/TodoItemFacade.cs Updated result namespace import
TodoSample/Facade/TodoItems/ITodoItemQueryFacade.cs Updated result namespace import
TodoSample/Facade/TodoItems/ITodoItemFacade.cs Updated result namespace import
TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/TodoItems/TodoItemsController.cs Updated result namespace import
Honamic.Framework.sln Added Applications.Abstractions project and build configurations
Comments suppressed due to low confidence (2)

src/Core/Domain/Extensions/ServiceCollectionExtensions.cs:9

  • [nitpick] The method name AddDefaultDomainsServices has an unexpected pluralization. Consider renaming to AddDefaultDomainServices for clarity.
public static IServiceCollection AddDefaultDomainsServices(this IServiceCollection services)

src/Core/Applications/Extensions/ServiceCollectionExtensions.cs:15

  • Missing using directive for Honamic.Framework.Applications.Extensions so that AddDefaultDomainsServices can be resolved.
services.AddDefaultDomainsServices();

@imhmdi imhmdi requested a review from Copilot May 20, 2025 21:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new project, Applications.Abstractions, to support a consistent results pattern across the framework and updates various package references and namespaces accordingly.

  • Added the Applications.Abstractions project with proper target framework and MSBuild settings.
  • Updated namespaces in exception classes and using directives in facade, query, and controller layers to reflect the new structure.
  • Upgraded package versions (EF Core, Swashbuckle, and dependency injection) and introduced a new CreateTodoItem2 command with its corresponding handler and registration.

Reviewed Changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Core/Applications.Abstractions/Honamic.Framework.Applications.Abstractions.csproj New project file establishing the Applications.Abstractions layer with modern MSBuild expressions.
src/Core/Applications.Abstractions/Exceptions/UnauthorizedException.cs Updated namespace from Facade.Exceptions to Applications.Exceptions.
src/Core/Applications.Abstractions/Exceptions/UnauthenticatedException.cs Updated namespace from Facade.Exceptions to Applications.Exceptions.
TodoSample/Infra/Query/Honamic.Todo.Query.EntityFramework.csproj Upgraded EF Core package versions.
TodoSample/Infra/Persistence/Honamic.Todo.Persistence.EntityFramework.csproj Upgraded EF Core package versions and aligned dependency references.
TodoSample/Facade/TodoItems/*.cs Updated using directives to reference the new Applications.Results namespace.
TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/TodoItems/TodoItemsController.cs Updated using directives and added a dedicated Create endpoint.
TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/TodoItems/TodoItems2Controller.cs Introduced a new controller for handling CreateTodoItem2 commands via the command bus.
TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/Honamic.Todo.Endpoints.WebApi.csproj Upgraded package references for EF Core and Swashbuckle.
TodoSample/Core/Domain/Honamic.Todo.Domain.csproj Upgraded Microsoft.Extensions.DependencyInjection.Abstractions version.
TodoSample/Core/Application/TodoItems/CommandHandlers/CreateTodoItem2CommandHandler.cs Added a handler for the CreateTodoItem2 command.
TodoSample/Core/Application/Extensions/ApplicationServiceCollectionExtensions.cs Registered the new CreateTodoItem2 command handler.
TodoSample/Core/Application.Contracts/TodoItems/Commands/CreateTodoItemCommand.cs Added the CreateTodoItem2Command record and its associated result command.
TodoSample/Core/Application.Contracts/Honamic.Todo.Application.Contracts.csproj Added a project reference to the new Applications.Abstractions project.
Honamic.Framework.sln Updated the solution file to include the new Applications.Abstractions project.
Comments suppressed due to low confidence (1)

TodoSample/Core/Application/TodoItems/CommandHandlers/CreateTodoItem2CommandHandler.cs:22

  • [nitpick] Consider using PascalCase for record properties (e.g. Title, Content, Tags) in CreateTodoItem2Command to align with common C# naming conventions.
var todoItem = new TodoItem(_idGenerator.GetNewId(), command.title, command.content, command.tags);

<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_").Replace(".Abstractions", ""))</RootNamespace>
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider documenting or extracting the MSBuild expression used for RootNamespace generation to improve clarity and maintainability.

Suggested change
<RootNamespace>$(MSBuildProjectName.Replace(" ", "_").Replace(".Abstractions", ""))</RootNamespace>
<!-- Define a property to generate the RootNamespace by replacing spaces with underscores and removing ".Abstractions" -->
<GeneratedRootNamespace>$(MSBuildProjectName.Replace(" ", "_").Replace(".Abstractions", ""))</GeneratedRootNamespace>
<RootNamespace>$(GeneratedRootNamespace)</RootNamespace>

Copilot uses AI. Check for mistakes.



public record CreateTodoItem2Command(string title, string content, List<string> tags)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

بهتره در یک فایل جدا نگهداری شود

@imhmdi imhmdi merged commit 7c90dfb into main May 21, 2025
@imhmdi imhmdi deleted the ComandResult branch May 21, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants