-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(TodoList): add commands * feat(use-case): add crud todo list and item * feat(usecase): add perfomance behavior and use case * fix: fix template and add params
- Loading branch information
1 parent
4bb418d
commit 5b9bfe3
Showing
58 changed files
with
948 additions
and
599 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
</Project> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
<metadata> | ||
<metadata> | ||
|
||
<id>Fast.Clean.Architecture.Solution.Template</id> | ||
<version>8.0.1</version> | ||
<title>Fast Clean Architecture Solution Template</title> | ||
<authors>christiandr</authors> | ||
<description>Fast Clean Architecture Solution Template for .NET 8.</description> | ||
<summary> | ||
A Clean Architecture Solution Template for creating apps using Web API only with DotNet. | ||
</summary> | ||
<id>Fast.Clean.Architecture.Solution.Template</id> | ||
<version>8.0.1</version> | ||
<title>Fast Clean Architecture Solution Template</title> | ||
<authors>christiandr</authors> | ||
<description>Fast Clean Architecture Solution Template for .NET 8.</description> | ||
<summary> | ||
A Clean Architecture Solution Template for create apps. | ||
</summary> | ||
<releaseNotes> | ||
</releaseNotes> | ||
|
||
<projectUrl>https://github.com/christianrd/FastCleanArchitecture</projectUrl> | ||
<repository type="git" url="https://github.com/christianrd/FastCleanArchitecture.git" branch="main" /> | ||
<projectUrl>https://github.com/christianrd/FastCleanArchitecture</projectUrl> | ||
<repository type="git" url="https://github.com/christianrd/FastCleanArchitecture.git" branch="main" /> | ||
|
||
<license type="expression">MIT</license> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<tags>fast-clean-architecture clean-architecture project template csharp dotnet</tags> | ||
<icon>icon.png</icon> | ||
<readme>README.md</readme> | ||
<license type="expression">MIT</license> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<tags>fast-clean-architecture clean-architecture project template csharp dotnet</tags> | ||
<icon>icon.png</icon> | ||
<readme>README.md</readme> | ||
|
||
<packageTypes> | ||
<packageType name="Template" /> | ||
</packageTypes> | ||
</metadata> | ||
<packageTypes> | ||
<packageType name="Template" /> | ||
</packageTypes> | ||
</metadata> | ||
|
||
<files> | ||
<file src=".template.config\icon.png" /> | ||
<file src="README.md" /> | ||
<file src=".\**" target="content" exclude="**\bin\**;**\obj\**;.\.vs\**;.\.vscode\**;content\Directory.Build.*;.\.git\**;.\.github\workflows\package.yml;.\.github\workflows\codeql.yml;.\.github\workflows\build.yml;.\.github\ISSUE_TEMPLATE\**;.\.github\icon.png;.\.github\FUNDING.md;.\CODE_OF_CONDUCT.md;.\LICENSE;.\README.md;" /> | ||
</files> | ||
<files> | ||
<file src=".template.config\icon.png" /> | ||
<file src="README.md" /> | ||
<file src=".\**" target="content" exclude="**\bin\**;**\obj\**;.\.vs\**;.\.vscode\**;content\Directory.Build.*;.\.git\**;.\.github\workflows\package.yml;.\.github\workflows\codeql.yml;.\.github\workflows\build.yml;.\.github\ISSUE_TEMPLATE\**;.\.github\icon.png;.\.github\FUNDING.md;.\CODE_OF_CONDUCT.md;.\LICENSE;.\README.md;" /> | ||
</files> | ||
</package> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using FastCleanArchitecture.Application.TodoItems.Commands.CreateTodoItem; | ||
using FastCleanArchitecture.Application.TodoItems.Commands.DeleteTodoItem; | ||
using FastCleanArchitecture.Application.TodoItems.Commands.UpdateTodoItem; | ||
using MediatR; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace FastCleanArchitecture.API.Controllers.TodoItems; | ||
|
||
[Route("api/[controller]")] | ||
public sealed class TodoItemsController(ISender sender) : ApiControllerBase(sender) | ||
{ | ||
[HttpPost] | ||
public async Task<IActionResult> CreateTodoItem([FromBody] CreateTodoItemCommand request) | ||
{ | ||
await Sender.Send(request); | ||
|
||
return NoContent(); | ||
} | ||
|
||
[HttpPut("{Id}")] | ||
public async Task<IActionResult> UpdateTodoItem(UpdateTodoItemCommand request) | ||
{ | ||
var result = await Sender.Send(request); | ||
if (result.IsFailed) | ||
return NotFound("Item not found."); | ||
|
||
return NoContent(); | ||
} | ||
|
||
[HttpDelete("{Id}")] | ||
public async Task<IActionResult> DeleteTodoItem([FromRoute] DeleteTodoItemCommand request) | ||
{ | ||
await Sender.Send(request); | ||
return NoContent(); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using FastCleanArchitecture.Application.TodoLists.Commands.Create; | ||
using FastCleanArchitecture.Application.TodoLists.Commands.Delete; | ||
using FastCleanArchitecture.Application.TodoLists.Commands.Update; | ||
using FastCleanArchitecture.Application.TodoLists.Queries.GetTodos; | ||
using MediatR; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace FastCleanArchitecture.API.Controllers.TodoLists; | ||
|
||
[Route("api/[controller]")] | ||
public sealed class TodoListsController(ISender Sender) : ApiControllerBase(Sender) | ||
{ | ||
[HttpGet(Name = nameof(GetTodoLists))] | ||
public async Task<IActionResult> GetTodoLists() | ||
{ | ||
var result = await Sender.Send(new GetTodosQuery()); | ||
return Ok(result.ValueOrDefault); | ||
} | ||
|
||
[HttpPost] | ||
public async Task<IActionResult> CreateTodoList(CreateTodoListCommand request) | ||
{ | ||
var result = await Sender.Send(request); | ||
if (result.IsFailed) | ||
return BadRequest(result.Errors); | ||
|
||
return CreatedAtRoute(nameof(GetTodoLists), result.Value); | ||
} | ||
|
||
[HttpPut("{Id}")] | ||
public async Task<IActionResult> UpdateTodoList(UpdateTodoListCommand request) | ||
{ | ||
var result = await Sender.Send(request); | ||
if (result.IsFailed) | ||
return BadRequest(result.Errors); | ||
|
||
return NoContent(); | ||
} | ||
|
||
[HttpDelete("{Id}")] | ||
public async Task<IActionResult> DeleteTodoList([FromRoute] DeleteTodoListCommand request) | ||
{ | ||
await Sender.Send(request); | ||
return NoContent(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"symbolInfo": { | ||
"featureName": { | ||
"longName": "feature-name", | ||
"shortName": "fn" | ||
}, | ||
"returnType": { | ||
"longName": "return-type", | ||
"shortName": "rt" | ||
}, | ||
"useCaseType": { | ||
"longName": "usecase-type", | ||
"shortName": "ut" | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.