- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
new project Applications.Abstractions for results #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.Abstractionsproject and wired it into solution and relevant csproj files
- Updated namespaces from Honamic.Framework.Facade.ResultstoHonamic.Framework.Applications.Resultsacross 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 AddDefaultEventssServices→AddDefaultEventsServicesand updated registrations | 
| src/Core/Domain/Extensions/ServiceCollectionExtensions.cs | Added AddDefaultDomainsServicesextension for domain services | 
| src/Core/Applications/Honamic.Framework.Applications.csproj | Referenced the new Applications.Abstractionsproject | 
| src/Core/Applications/Extensions/ServiceCollectionExtensions.cs | Updated AddDefaultApplicationsServicesto 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.Abstractionsproject and build configurations | 
Comments suppressed due to low confidence (2)
src/Core/Domain/Extensions/ServiceCollectionExtensions.cs:9
- [nitpick] The method name AddDefaultDomainsServiceshas an unexpected pluralization. Consider renaming toAddDefaultDomainServicesfor clarity.
public static IServiceCollection AddDefaultDomainsServices(this IServiceCollection services)
src/Core/Applications/Extensions/ServiceCollectionExtensions.cs:15
- Missing using directive for Honamic.Framework.Applications.Extensionsso thatAddDefaultDomainsServicescan be resolved.
services.AddDefaultDomainsServices();
…mand execution and error handling.
There was a problem hiding this 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> | 
    
      
    
      Copilot
AI
    
    
    
      May 20, 2025 
    
  
There was a problem hiding this comment.
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.
| <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> | 
|  | ||
|  | ||
|  | ||
| public record CreateTodoItem2Command(string title, string content, List<string> tags) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
بهتره در یک فایل جدا نگهداری شود
No description provided.