Skip to content

Commit a97b9d6

Browse files
authored
Merge branch 'main' into refactor/FluentBuilder
2 parents 0b48008 + 5997039 commit a97b9d6

File tree

143 files changed

+288
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+288
-452
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageVersion Include="Ardalis.SmartEnum" Version="8.1.0" />
1010
<PackageVersion Include="Ardalis.Specification" Version="8.0.0" />
1111
<PackageVersion Include="Ardalis.Specification.EntityFrameworkCore" Version="8.0.0" />
12-
<PackageVersion Include="Azure.Identity" Version="1.12.1" />
12+
<PackageVersion Include="Azure.Identity" Version="1.13.0" />
1313
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
1414
<PackageVersion Include="FastEndpoints" Version="5.30.0" />
1515
<PackageVersion Include="FastEndpoints.ApiExplorer" Version="2.2.0" />
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Architecture Decision Records (ADR)
2+
3+
## What is an Architecture Decision Record (ADR)?
4+
An Architecture Decision Record (ADR) documents significant architecture decisions made throughout a project, capturing the context, rationale, and consequences of each decision. This promotes transparency and provides a historical reference for future design considerations.
5+
6+
## Purpose of ADRs
7+
- **Knowledge Management**: Consolidates architectural knowledge and decisions.
8+
- **Collaboration**: Enhances team communication by documenting discussions and outcomes.
9+
- **Clarity**: Provides clear reasoning behind design choices, making it easier for new team members to understand past decisions.
10+
11+
## Best Practices for Writing ADRs
12+
1. **Be Specific**: Each ADR should address a single architectural decision. Avoid conflating multiple decisions into one record.
13+
2. **Document Context**: Clearly explain the project’s context and relevant considerations that influenced the decision. Include team dynamics and priorities.
14+
3. **Rationale and Consequences**: Describe the reasons for the decision, including pros and cons, and outline the implications of the decision for the project and
15+
16+
future architecture.
17+
4. **Immutable Records**: Once an ADR is created, avoid altering it. Instead, create a new ADR to reflect any changes or updates.
18+
5. **Timestamp Entries**: Include timestamps to track when each decision was made, especially for aspects that may evolve over time (e.g., costs, schedules).
19+
6. **Use Templates**: Utilize established templates for consistency and completeness in documenting ADRs.
20+
21+
## Versioning ADRs
22+
- **Track Changes**: Each time an ADR is updated or a new version is created, increment the version number (e.g., `v1.0`, `v1.1`, etc.) to reflect changes clearly.
23+
- **Document Changes**: Include a "Changelog" section in the ADR to summarize what has changed in each version. This can include updates to the rationale, context, or decision consequences.
24+
- **Maintain Clarity**: Ensure the latest version is easily accessible while keeping older versions for reference. You might consider using a version control system (e.g., Git) to manage this effectively.
25+
26+
## How to Start Using ADRs
27+
1. **Identify Decisions**: Collaborate with your team to identify significant architecture decisions that need documentation.
28+
2. **Select a Tool**: Choose a tool for documenting ADRs (e.g., markdown files in a Git repository, Google Docs, project management tools).
29+
3. **Create ADRs**: For each decision, create an ADR file in the `adr` directory, following naming conventions (e.g., `choose-database.md`).
30+
31+
## File Name Conventions
32+
- Use a present tense imperative verb phrase.
33+
- Separate words with lowercase letters and dashes.
34+
- Use `.md` extension for markdown formatting.
35+
36+
## Templates
37+
Refer to the following templates for structuring your ADRs:
38+
- [Decision record template by Michael Nygard](https://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions)
39+
- [Decision record template by Jeff Tyree and Art Akerman](https://github.com/adr/adr)
40+
- [MADR project templates](https://adr.github.io/madr/)
41+
42+
## Teamwork Advice for ADRs
43+
- Foster a culture of collaborative decision-making and ensure ADRs are seen as valuable tools rather than bureaucratic requirements.
44+
- Consider using the term "decisions" instead of "ADRs" to encourage engagement.
45+
- Maintain living documents by updating existing ADRs with new information rather than rewriting them.
46+
47+
## For More Information
48+
- [Architectural Decision Wikipedia](https://en.wikipedia.org/wiki/Architectural_decision)
49+
- [Markdown Architectural Decision Records](https://adr.github.io/)
50+
- [Tools for working with ADRs](https://github.com/adr/adr)
51+
52+
By following these guidelines, your team can effectively leverage ADRs to enhance architectural decision-making and project transparency while keeping a clear version history of all architectural decisions.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ADR 001: Replace Autofac with .NET Core Dependency Injection
2+
3+
## Status
4+
Accepted
5+
6+
## Context
7+
Initially, this repository employed Autofac for dependency injection. At the time of adoption, Autofac was preferred due to its robust feature set, including:
8+
- Support for advanced scenarios such as decorators and modules, which could be placed close to their corresponding implementations.
9+
- A well-established history of stability and maturity, having been used in various projects before .NET Core's built-in DI was fully featured.
10+
11+
As the .NET ecosystem evolved, the built-in DI container began to meet the needs of our project without introducing the added complexity associated with Autofac. The .NET DI framework has matured significantly, offering sufficient functionality for typical use cases, including:
12+
- Improved support for configuration through extension methods.
13+
- A simpler learning curve for new contributors familiar with .NET conventions.
14+
15+
## Decision
16+
Based on community feedback and a review of our project's requirements, we have decided to remove Autofac from this template and transition to using .NET's built-in dependency injection infrastructure. This decision aligns with the goal of simplifying the codebase and reducing external dependencies.
17+
18+
## Consequences
19+
- **Simplified Codebase**: Removing Autofac results in a cleaner, more maintainable codebase that adheres to .NET standards.
20+
- **Reduced Complexity**: The transition eliminates the need for additional files and configurations specific to Autofac, making the project easier to understand for new contributors.
21+
- **Standardization**: Adopting .NET's built-in DI promotes consistency with other .NET projects, making it easier for developers familiar with the framework to contribute effectively.
22+
23+
## References
24+
- [Issue #649: Why is this repo using Autofac instead of .NET's own DI infrastructure?](https://github.com/your-repo/issues/649) - Discussion that led to this decision.
25+
- [Getting Started with Architecture Decision Records](https://ardalis.com/getting-started-with-architecture-decision-records/) - Resource on ADR best practices.

sample/src/NimblePros.SampleToDo.Infrastructure/Data/AppDbContext.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System.Reflection;
2-
using Ardalis.SharedKernel;
3-
using NimblePros.SampleToDo.Core.ContributorAggregate;
1+
using NimblePros.SampleToDo.Core.ContributorAggregate;
42
using NimblePros.SampleToDo.Core.ProjectAggregate;
5-
using Microsoft.EntityFrameworkCore;
63

74
namespace NimblePros.SampleToDo.Infrastructure.Data;
85

sample/src/NimblePros.SampleToDo.Infrastructure/Data/Config/ContributorConfiguration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using NimblePros.SampleToDo.Core.ContributorAggregate;
2-
using Microsoft.EntityFrameworkCore;
3-
using Microsoft.EntityFrameworkCore.Metadata.Builders;
42

53
namespace NimblePros.SampleToDo.Infrastructure.Data.Config;
64

sample/src/NimblePros.SampleToDo.Infrastructure/Data/Config/ProjectConfiguration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using NimblePros.SampleToDo.Core.ProjectAggregate;
2-
using Microsoft.EntityFrameworkCore;
3-
using Microsoft.EntityFrameworkCore.Metadata.Builders;
42

53
namespace NimblePros.SampleToDo.Infrastructure.Data.Config;
64

sample/src/NimblePros.SampleToDo.Infrastructure/Data/Config/ToDoConfiguration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using NimblePros.SampleToDo.Core.ProjectAggregate;
2-
using Microsoft.EntityFrameworkCore;
3-
using Microsoft.EntityFrameworkCore.Metadata.Builders;
42

53
namespace NimblePros.SampleToDo.Infrastructure.Data.Config;
64

sample/src/NimblePros.SampleToDo.Infrastructure/Data/EfRepository.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using Ardalis.Specification.EntityFrameworkCore;
2-
using Ardalis.SharedKernel;
3-
4-
namespace NimblePros.SampleToDo.Infrastructure.Data;
1+
namespace NimblePros.SampleToDo.Infrastructure.Data;
52

63
// inherit from Ardalis.Specification type
74
public class EfRepository<T> : RepositoryBase<T>, IReadRepository<T>, IRepository<T> where T : class, IAggregateRoot

sample/src/NimblePros.SampleToDo.Infrastructure/Data/Queries/ListContributorsQueryService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using NimblePros.SampleToDo.UseCases.Contributors;
2-
using Microsoft.EntityFrameworkCore;
32
using NimblePros.SampleToDo.UseCases.Contributors.Queries.List;
43

54
namespace NimblePros.SampleToDo.Infrastructure.Data.Queries;

sample/src/NimblePros.SampleToDo.Infrastructure/Data/Queries/ListIncompleteItemsQueryService.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Microsoft.Data.SqlClient;
2-
using Microsoft.EntityFrameworkCore;
3-
using NimblePros.SampleToDo.UseCases.Projects;
1+
using NimblePros.SampleToDo.UseCases.Projects;
42
using NimblePros.SampleToDo.UseCases.Projects.ListIncompleteItems;
53

64
namespace NimblePros.SampleToDo.Infrastructure.Data.Queries;

0 commit comments

Comments
 (0)