Currently um working in an application and it has the following hierarchy
WEB API2 Controllers (hilds the end points)
Business Logic Layer (Dedicated for business logic handling )
Data Access Layer (Repositories)
If we want to impose a validation which does not related to a business logic as for an example a character count validation for a specific field in an entity , what will be the ideal place to implement it?
Some says it should be on Controller it self , but I cannot agree with it .
You must not be dogmatic when using layered architecture. You may measure some abstraction to any piece of function. This measure can well be flexible.
In your concrete example you are looking at validating a string size for an entity. Now, the name entity puts this near the data layer, which is where I would place it. So your data layer may raise an access violation if someone tries to place an entity with a wrong length.