Add SmsSenderExtensions and add constructor to the SmsMessage class.

pull/594/head
Halil ibrahim Kalkan 6 years ago
parent 06f311f023
commit 4de7ca3fa0

@ -1,15 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace Volo.Abp.Sms
{
public class SmsMessage
{
public string PhoneNumber { get; set; }
public string PhoneNumber { get; }
public string Text { get; set; }
public string Text { get; }
public IDictionary<string, object> Properties { get; set; }
public IDictionary<string, object> Properties { get; }
public SmsMessage([NotNull] string phoneNumber, [NotNull] string text)
{
PhoneNumber = Check.NotNullOrWhiteSpace(phoneNumber, nameof(phoneNumber));
Text = Check.NotNullOrWhiteSpace(text, nameof(text));
Properties = new Dictionary<string, object>();
}
}
}

@ -0,0 +1,14 @@
using JetBrains.Annotations;
using System.Threading.Tasks;
namespace Volo.Abp.Sms
{
public static class SmsSenderExtensions
{
public static Task SendAsync([NotNull] this ISmsSender smsSender, [NotNull] string phoneNumber, [NotNull] string text)
{
Check.NotNull(smsSender, nameof(smsSender));
return smsSender.SendAsync(new SmsMessage(phoneNumber, text));
}
}
}
Loading…
Cancel
Save