refactor(database): update seed pipeline to use dapper (#277)

This commit is contained in:
Aaron Po
2026-09-05 00:37:14 -04:00
committed by GitHub
parent 78ad32e93a
commit d9411eb00e
43 changed files with 1023 additions and 735 deletions

View File

@@ -0,0 +1,6 @@
using MediatR;
namespace Features.Locations.Commands.CreateStateProvince;
public record CreateStateProvinceCommand(string StateProvinceName, string IsoCode, Guid CountryId)
: IRequest<Guid>;

View File

@@ -0,0 +1,18 @@
using Features.Locations.Repository;
using MediatR;
namespace Features.Locations.Commands.CreateStateProvince;
public class CreateStateProvinceHandler(ILocationRepository repository)
: IRequestHandler<CreateStateProvinceCommand, Guid>
{
public Task<Guid> Handle(
CreateStateProvinceCommand request,
CancellationToken cancellationToken
) =>
repository.CreateStateProvinceAsync(
request.StateProvinceName,
request.IsoCode,
request.CountryId
);
}