(Best Practice) FluentValidation and Checking Duplicate Entities
问题 I have a table (junction table) with 3 primary keys so when I want to check duplicate records , I must check 3 properties together I wrote a method like this private bool IsDuplicate(long roleId, long componentGroupId, long operationId) { var business = new RoleGroupBusiness(); var result = business.Where(x => x.RoleID == roleId && x.ComponentGroupID == componentGroupId && x.OperationID == operationId).Any(); return result; } and I have a FluentValidator class like this : public class