aspnetrun / run-aspnetcore-microservices

Microservices on .Net platforms which used ASP.NET Web API, Docker, RabbitMQ, MassTransit, Grpc, Yarp API Gateway, PostgreSQL, Redis, SQLite, SqlServer, Marten, Entity Framework Core, CQRS, MediatR, DDD, Vertical and Clean Architecture implementation with using latest features of .NET 8 and C# 12
https://www.udemy.com/course/microservices-architecture-and-implementation-on-dotnet/?couponCode=JUNE24
MIT License
2.53k stars 1.38k forks source link

Transaction in ordering #32

Closed DavoodRm closed 2 years ago

DavoodRm commented 2 years ago

hi How do I create a transaction in the handle? Given that OrderDbContext is in the Infrastructure layer. Transactions can be managed using Behaviours, but I do not have access to Infrastructure in the application layer

mehmetozkaya commented 2 years ago

If your transaction is only in ordering microservice, then you can implement uow in the Infrastructure layer. But if transactions need to touch several microservices then things are going to complicate more, so we can apply a saga pattern.