-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
Hi, I have problem with the way how you implemented some of your constructors. Classes that I found for now with that implementation are SmsTextualMessage and SmsAdvancedTextualRequest.
Both have all parameters as optional, but in implementation of constructor there is check if some parameters are null.
For example:
var smsRequest = new SmsAdvancedTextualRequest()
{
Messages = [smsMessages]
};will built without any error, but during execution exception will be thrown because of:
public SmsAdvancedTextualRequest(string bulkId = null, List<SmsTextualMessage> messages = null, SmsSendingSpeedLimit sendingSpeedLimit = null, SmsUrlOptions urlOptions = null, SmsTracking tracking = null, bool includeSmsCountInResponse = false)
{
Messages = messages ?? throw new ArgumentNullException("messages");
BulkId = bulkId;
SendingSpeedLimit = sendingSpeedLimit;
UrlOptions = urlOptions;
Tracking = tracking;
IncludeSmsCountInResponse = includeSmsCountInResponse;
}I would expect build time error for this case