C
C#16mo ago
bookuha

❔ CRUD(REST) + DDD

Hi, I’m developing a simple CRUD messenger and trying to also have it DDD’ed. The problem is that the interaction interface is REST, and I want to update a specific message content/recipient/color. By terms of DDD I could simply get some domain services, aggregates with this logic injected or value objects and simply call the ChangeMessageColor(Message) method. But REST, the way I understand it, makes me expose a single PUT message/id endpoint, that will receive any changes to the resource
3 Replies
bookuha
bookuha16mo ago
There are some ways I see to handle this: 1) Change entity using JsonPatch, then run a domain validator on it (looks very bad) 2) Define EntityDomainService.Update() & Entity.Update() methods that will validate any changes that happen 3) In Application Service figure our what properties have changed, then call related Entity.UpdatePropertyName1(), UpdatePropertyName2() methods 3) looks the most correct yet the most difficult way and I have never seen anything like that before 1) looks simple and working, but not so expressive How would you handle this kind of logic?
bookuha
bookuha16mo ago
GitHub
eShopOnWeb/UpdateCatalogItemEndpoint.cs at main · dotnet-architectu...
Sample ASP.NET Core 6.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder. - eS...
Accord
Accord16mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
✅ ERROR: An exception was thrown while attempting to evaluate a LINQ query parameter expressionwhen a user clicks in this button. He will be go to the AddToCart() method in my ShoppingCartControl✅ If else statement problemEven or odd number I got a problem to write an app to specify every digit from a number of 4 digits❔ Razor Pages: Temporary Sites like Doodle Surveys with an Share Link?Hey everyone, is it Possible in Razor Pages to create "temporary" Pages?` I would like to create som✅ nuget naming nuances - Microsoft.Extensions.Configuration.Yaml doesn't belong to MicrosoftCan package names be whatever the uploader desires and there's no indication of hierarchy, as far as❔ Creating a base abstract class to ensure a set of derived classes receive similar dependencies?Hi, working on creating a class library and I have a set of classes, let's call them PlainPizza, Pep❔ Using razor pages to generate a list and send to code fileSo I have a table called GenericEvents, and I have various activities that use this generic event toUpdate JSON File with new values without overwriting existing dataHello, So I'm currently developing a Discord bot that stores values such as 'settings' for each gu❔ How to add a list of type of another class in c#?I'm doing a program where I need to store the a list of the Person class in the class of People. A P❔ just a quick help```cs using System; using System.Collections.Generic; using System.Linq; class Program { static✅ Multi-targeting NetFx and NetCore - Targeting wrong version?# History My last post was a bit of a mess so I've come here to help clean it up a bit. I have a p