I have a three tier architecture API to add and remove customers. Every customer has some employees that are responsible for that customer. Those employees are located in another collection of documents (I am using a NoSQL db) So if I am adding or updating a customer the customers gets a list of employeeIds that reference those employees. When a customer is now submitted, I have to check all those ids in a validation method:
function CheckIfAllEmployeeIdsHaveExistingEmployee(List<string> employeeIds) {...} Would you do this in the DAL or in the BL? I am currently doing everything in the BL and only very simple CRUD operations and views are done in the DAL. But this logic was also a "database logic" in my SQL-times.
What do you think?