This file contains hidden or 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
package cmd | |
import ( | |
"fmt" | |
"github.com/spf13/cobra" | |
"os" | |
) | |
var rootCmd = &cobra.Command{ | |
Use: "zmp3", |
This file contains hidden or 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
version: '2' | |
services: | |
customer-api: | |
container_name: customer-api | |
build: | |
context: . | |
dockerfile: Dockerfile | |
depends_on: | |
- mssql |
This file contains hidden or 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
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env | |
WORKDIR /app | |
COPY . ./ | |
RUN dotnet restore | |
RUN dotnet publish -c Release -o out | |
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 | |
WORKDIR /app | |
COPY --from=build-env /app/Customer.API/out . |
This file contains hidden or 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
"ConnectionStrings": { | |
"DefaultConnection": "Data Source=localhost;Initial Catalog=CustomerDB;User Id=sa;Password=Demo123456@;" | |
} |
This file contains hidden or 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
using System; | |
using System.Threading.Tasks; | |
using Customer.Domain.Commands; | |
using Customer.Domain.Dtos; | |
using Customer.Domain.Queries; | |
using MediatR; | |
using Microsoft.AspNetCore.Mvc; | |
namespace Customer.API.Controllers | |
{ |
This file contains hidden or 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
using System; | |
using System.Threading.Tasks; | |
using MediatR; | |
using Microsoft.AspNetCore.Mvc; | |
namespace Customer.API.Controllers | |
{ | |
[ApiController] | |
[Route("api/[controller]")] | |
[Produces("application/json")] |
This file contains hidden or 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
services.AddScoped<ICustomerRepository, CustomerRepository>(); | |
services.AddScoped<ICustomerDxos, CustomerDxos>(); |
This file contains hidden or 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
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Customer.Data.IRepositories; | |
using Customer.Domain.Events; | |
using MediatR; | |
using Microsoft.Extensions.Logging; | |
namespace Customer.Service.Subcribers | |
{ |
This file contains hidden or 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
using System; | |
using MediatR; | |
namespace Customer.Domain.Events | |
{ | |
public class CustomerCreatedEvent : INotification | |
{ | |
public Guid CustomerId { get; } | |
public CustomerCreatedEvent(Guid customerId) |
This file contains hidden or 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
using AutoMapper; | |
using Customer.Domain.Dtos; | |
namespace Customer.Service.Dxos | |
{ | |
public class CustomerDxos : ICustomerDxos | |
{ | |
private readonly IMapper _mapper; | |
public CustomerDxos() |