-
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.
- Loading branch information
1 parent
c6ad6ae
commit ee473f4
Showing
20 changed files
with
1,065 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using MediatR; | ||
using Microsoft.AspNetCore.Http.HttpResults; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Product.Application.Product.Commands.CreateProduct; | ||
using Product.Application.Product.Queries.GetProduct; | ||
|
||
namespace Product.API.Controllers; | ||
|
||
[Controller] | ||
public sealed class ProductsController : Controller | ||
{ | ||
private readonly IMediator _mediator; | ||
public ProductsController(IMediator mediator) | ||
{ | ||
_mediator = mediator; | ||
} | ||
|
||
[HttpPost] | ||
public async Task<IActionResult> Product(CreateProductCommand command) | ||
{ | ||
await _mediator.Send(command); | ||
return Ok(); | ||
} | ||
|
||
[HttpGet] | ||
public async Task<IActionResult> Product(GetProductQuery query) | ||
{ | ||
var response = await _mediator.Send(query); | ||
return Ok(response); | ||
} | ||
} |
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
Binary file not shown.
Binary file modified
BIN
+7.67 KB
(110%)
Src/Product.API/obj/Debug/net7.0/Product.API.csproj.AssemblyReference.cache
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no"?> | ||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> | ||
<Import Project="$(NuGetPackageRoot)system.diagnostics.diagnosticsource/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/System.Diagnostics.DiagnosticSource.targets" Condition="Exists('$(NuGetPackageRoot)system.diagnostics.diagnosticsource/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/System.Diagnostics.DiagnosticSource.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server/6.0.5/build/Microsoft.Extensions.ApiDescription.Server.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server/6.0.5/build/Microsoft.Extensions.ApiDescription.Server.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.primitives/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Primitives.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.primitives/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Primitives.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.dependencyinjection.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.dependencyinjection.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.options/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Options.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.options/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Options.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.logging.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.logging.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.fileproviders.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.FileProviders.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.fileproviders.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.FileProviders.Abstractions.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.diagnostics.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Diagnostics.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.diagnostics.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Diagnostics.Abstractions.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.configuration.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Configuration.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.configuration.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Configuration.Abstractions.targets')" /> | ||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.hosting.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Hosting.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.hosting.abstractions/9.0.0-preview.2.24128.5/buildTransitive/netcoreapp2.0/Microsoft.Extensions.Hosting.Abstractions.targets')" /> | ||
</ImportGroup> | ||
</Project> |
Oops, something went wrong.