private void ValidateProps() { if (GenericTypeDefinition == null) { throw new InvalidOperationException( $"ProtoCMS: generic type definition required."); } if (!GenericTypeDefinition.IsGenericTypeDefinition) { throw new InvalidOperationException( $"ProtoCMS: provided type is not a generic type definition."); } if (GenericTypeArgumentsMatcher == null) { throw new InvalidOperationException( $"ProtoCMS: generic type arguments matcher is required."); } if (GenericTypeDefinition.GetGenericArguments().Length != GenericTypeArgumentsMatcher.Length) { throw new InvalidOperationException( $"ProtoCMS: generic type arguments matcher length is different than expected arguments length of " + $"the generic type definition."); } if (GenericTypeArgumentsMatcher.Any(x => x == null)) { throw new InvalidOperationException( $"ProtoCMS: generic type arguments matcher must not have null item."); } }