Posts

Posts uit 2025 tonen

NServiceBus

 NServicebus = abstraction over een service bus broker.. voorkeur masstransit  endpoint configuration = basis, geef je naam, gewoon logische naam, bijv "Sales".  endpoint serialization -> welke serializer moet gebruikt worden  endpoint transport = medium dat de messages transporteert (memory, azure service bus, rabbitmq, etc). LearningTransport is een memory implementation. Dus de berichten gaan nu via het geheugen.  endpointInstance =  Endpoint.start(endpointConfiguration)      -> start de service, een background service  Nservicebus kent 3 soortenm messages 1. command: 1 of meerdere senders, altijd 1 receiver. Doel is om een plek iets te laten doen. naming is dan: PlaceOrder, DoSomething 2. event: pub sub scenario: 1 sender, meerdere receivers. Doel: laat de wereld weten dat er iets is gebeurt: OrderPlaced, UserLoggedIn 3. message: voor alle overige berichten, bijv een reply op een request/response public class ExampleCommand : I...

EF Core

Packages  Microsoft.EntityFrameworkCore.Design: - scaffolding - migrations - reverse engineering Microsoft.EntityFrameworkCore.Tools: - command-line tooling support voor Package Manager Console (PMC)     - Add-Migration     - Update-Database     - Remove-Migration     - Scaffold-DbContext     - Drop-Database     - Script-Migration Commands PMC: - Migration aanmaken     Add-Migration TheNameOfTheMigration --> creates a migration cs file in the Migrations folder - Database bijwerken     Update-Database ---- After modifying the (domain) model, you need to create a new migration (so the DB will also be updated):     Add-Migration DescriptionOfTheModification Next update the database again:     Update-Database ---- After each time Add-migration is run, EFCore automatically creates a Snapshot file, also located in the Migrations folder. Working of the Change tracker https://www.youtube....