Open OwenLacey28 opened 9 months ago
Attempted to replicate this again and got the below error message
System.ArgumentException
Property 'System.Collections.Generic.ICollection`1[Audacia.Seed.Tests.Customisations.EntitySeedExtensionTests+IPet] Pets' is not defined for type 'XXX+DogOwner' (Parameter 'property')
at System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property)
at Audacia.Core.Extensions.Helpers.ParameterReplacer.VisitMember(MemberExpression node)
at System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor visitor, IArgumentProvider nodes)
at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node)
at Audacia.Core.Extensions.Helpers.ParameterReplacer.VisitLambda[T](Expression`1 node)
at Audacia.Core.Extensions.ExpressionExtensions.ConvertGenericTypeArgument[TSource,TTarget,TResult](Expression`1 root)
Consider the following data model:
The following code throws an error:
Error:
Whereas this works fine:
I have narrowed this down to the
Expression<Func<IHavePet<IPet>, bool>>
containing a nested Lamba. It seems that we're replacing attempting to replace theIPet
parameter in the nested lambda as well as the root lambda, resulting in a null reference (not sure where from.