You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if we remove the class constraint, the .Map() will throw the following exception:
System.ArgumentException: Allow only member access (eg. obj => obj.Child.Name) (Parameter 'lambda')
at Mapster.Utils.ExpressionEx.GetMemberPath(LambdaExpression lambda, Boolean firstLevelOnly, Boolean noError)
at Mapster.TypeAdapterSetter`2.Map[TDestinationMember,TSourceMember](Expression`1 member, Expression`1 source, Expression`1 shouldMap)
The Map() will work well as soon as we add the class constraint. (Mapping into structs also wouldn't make any sense, since that would only map into a copy.)
More methods might profit from the class constraint, but this is the one we had the issue with. If the method had a class constraint in the first place, we would have had to add it to our code to be able to even compile.
The text was updated successfully, but these errors were encountered:
In class
TypeAdapterSetter<TSource, TDestination>
, the following methodand probably some more should have a "where TDestination: class" constraint.
We have an extension method that looks like this:
if we remove the class constraint, the .Map() will throw the following exception:
The Map() will work well as soon as we add the class constraint. (Mapping into structs also wouldn't make any sense, since that would only map into a copy.)
More methods might profit from the class constraint, but this is the one we had the issue with. If the method had a class constraint in the first place, we would have had to add it to our code to be able to even compile.
The text was updated successfully, but these errors were encountered: