© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
19 replies
bookuha

[ASP.NET] B-Logic Services, Validation

I am using anemic models, therefore I want to implement Business Logic Services.

And the questions are:

1) When to create a service? Should it cover entity and entities related to it (like aggregate in DDD)
Example: I have a class Book, that uses Description, Authors objects in it.
Should I create a class BookService that can manage Books and their descriptions and authors, or should I create + 2 service classes for the related entites and use them along with the BookService?
When do I separate the logic in them?

2) What should the methods return? I am aware of concept of Either/Result, but I don't want to implement them

3) Should I throw exception directly in these methods and rely on some middleware to make them shiny for the UI?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ ValidationContext in ASP.NET
C#CC# / help
3y ago
asp.net core services initialization
C#CC# / help
4y ago
ASP.NET - Domain Models Validation
C#CC# / help
2y ago