I have a question about a use case. I'm dealing with a cataloging system for books and one use case is such that the user is required to enter either the book's ISBN or the author and the title prior to performing a look-up and saving the business class to the database.
I am overriding the AddBusinessRules method and have the title and author properties as dependent properties of each other via the isBidirectional argument being set to true. If either property contains a value, I'm validating that the other property similarly contains a value; additionally, I perform checks to make sure they don't exceed the length set for their fields in the database. The thing is I don't have to perform any of the above checks if the user has made an entry for the ISBN; all I have to do in that instance is validate that the entry is a correct entry for an ISBN. If none of the properties contain a value, the object is deemed to be invalid and thus cannot be saved to the database.
Am I going about improperly overriding the AddBusinessRules method in what I'm attempting? Is there a better way?
Copyright (c) Marimer LLC