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
mapster has provided the function of not copying the property when the value of the property is null. Can we extend this function to stop copying the property when the value of the property is a series of specific values? It is better to provide a general method (I am not sure which property and which type, but I am sure that the value cannot be these)? Determine whether a property field can be copied before it is copied
// Can you provide such a method // Another framework, automapper, already provides similar functionality// I don't care about the attribute name, but I care about the attribute value, and providing the attribute name is best when determining the attribute valueIgnoreMember((srcMember,destMember,srcValue,destValue)=>{if(srcValueisstringsrcValueTxt){returnstring.IsNullOrWhiteSpace(srcValueTxt);}if(srcValue==destValue){returntrue;}returnfalse;})
The text was updated successfully, but these errors were encountered:
You're right, but when there are many attributes, configuring them one by one can be cumbersome. I need a universal and concise way。Similar to the IgnoreNullValues method, but I need to independently determine which values cannot be copied, such as empty strings
mapster has provided the function of not copying the property when the value of the property is null. Can we extend this function to stop copying the property when the value of the property is a series of specific values? It is better to provide a general method (I am not sure which property and which type, but I am sure that the value cannot be these)? Determine whether a property field can be copied before it is copied
The text was updated successfully, but these errors were encountered: