Open Closed

Checks and exception types in entities created by Abp Suite #5826


User avatar
0
ademaygun created
  • ABP Framework version: v7.3.2

  • UI Type: Angular

  • Database System: EF Core

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

  • Exception message and full stack trace:

  • Steps to reproduce the issue:

When I create an entity with Abp Suite, I notice that some length and not-null checks are being performed.

  1. Why is BusinessException not being thrown in checks made with the Check class, and instead ArgumentException/ArgumentNull exceptions are thrown? (I don't see any drawback to throwing a business exception in the domain layer)

  2. The relevant checks are being performed in the constructor, but the properties have accessible set accessors. There is also a gap here.

If you agree with what I've mentioned in both points, Abp Suite should generate more robust code and I expect a change in this regard.


3 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10