© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
42 replies
Bluestopher

❔ Business Logic Validation in Service Layer

Hey all,

I’m working on validating my domain objects that are passed from my framework and drivers (controllers, gRPC service, ect) in my service layer. I’m not sure what the best approach is to apply business logic on my domain entity and have chose to pickup fluentvalidation. This feels a bit overkill, but I’m not sure on what other approaches people use currently. I do not want to throw an exception for business logic validation since it is quite expensive and I would rather return a detailed message that valid failed with a list of errors for all of the validations that failed.

Does anyone have any recommendations on patterns for performing validation in the service layer so I can return detailed error responses back to the controller without throwing an exception? I heard about return errors apart of a task, but I have not seen any examples of how this is accomplished.
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

Business Logic Problem
C#CC# / help
14mo ago
Presentation layer vs business layer vs data layer
C#CC# / help
5mo ago
Logging from disconnected Business logic
C#CC# / help
15mo ago
❔ Service layer design
C#CC# / help
3y ago