private void CheckForDuplicateAndAddInterceptors(SyncInterceptorAttribute attr, MethodInfo info, string className, ref MethodInfo nonFilteredInfo, Dictionary <Type, MethodInfo> filteredInfo) { // Check we dont have two non filtered interceptors for same operation if (nonFilteredInfo != null) { throw WebUtil.ThrowDuplicateInterceptorException(className, this.ScopeName, attr); } // Check we dont have a filtered and non filtered interceptors for same operation if ((attr.EntityType != null && nonFilteredInfo != null) || (attr.EntityType == null && filteredInfo.Count != 0)) { throw WebUtil.ThrowFilteredAndNonFilteredInterceptorException(className, this.ScopeName, attr); } if (attr.EntityType != null) { // If filtered, ensure we dont have duplicates in type if (filteredInfo.ContainsKey(attr.EntityType)) { throw WebUtil.ThrowDuplicateInterceptorForArgumentException(className, this.ScopeName, attr, attr.EntityType.FullName); } // Check that argument is of type IOfflineEntity if (!SyncServiceConstants.IOFFLINEENTITY_TYPE.IsAssignableFrom(attr.EntityType)) { throw WebUtil.ThrowInterceptorArgumentNotIOEException(className, this.ScopeName, attr, attr.EntityType.FullName); } // If not then its valid. So add it to the list filteredInfo.Add(attr.EntityType, info); } else { // Its a valid non filtered interceptor. nonFilteredInfo = info; } }