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
I've encountered an issue while using the client.SingleSends.GetAsync method where certain properties are not binding as expected. Specifically, attempting to access the EmailConfig and SendTo properties of the SingleSend model results in a NullReferenceException. This issue likely arises because these properties are designed for internal use, as indicated by their current accessibility level.
Furthermore, the related models SingleSendEmailConfig and SingleSendSendTo are also set to internal access modifiers, making it necessary to change their accessibility to public to allow external access.
Thanks for reporting this issue. It appears this problem was introduced in January 2022 in release 0.87.0 when we replaced Newtonsoft's JSON library with Microsoft's System.Text.Json due to the fact that Microsoft's Json parser does not deserialized private members (such as SingleSend.EmailConfig and SingleSend.SendTo in this instance) while Newtonsoft's parser did deserialize such private members.
Let me think about how I'm going to overcome to limitation...
As you hinted in your original comment, the simplest solution is to change the EmailConfig and the SendTo properties to public and do the same to their corresponding model classes.
When I do that, several properties on the SingleSend class will become redundant (such as Subject and HtmlContent for example). Therefore I will remove these redundant properties.
Finally, I will use this opportunity to rename SendTo to Recipients which is much clearer.
Hello,
I've encountered an issue while using the
client.SingleSends.GetAsync
method where certain properties are not binding as expected. Specifically, attempting to access theEmailConfig
andSendTo
properties of theSingleSend
model results in a NullReferenceException. This issue likely arises because these properties are designed for internal use, as indicated by their current accessibility level.Furthermore, the related models
SingleSendEmailConfig
andSingleSendSendTo
are also set to internal access modifiers, making it necessary to change their accessibility to public to allow external access.https://github.com/Jericho/StrongGrid/blob/develop/Source/StrongGrid/Models/SingleSend.cs#L218-L221
The text was updated successfully, but these errors were encountered: