问题描述
公共类SmsService:IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
{
string AccountSid =" myAccountSID" ;;
string AuthToken =" myAuthToken" ;;
string twilioPhoneNumber =" MyTwilioPhoneNumber" ;;
var twilio = new TwilioRestClient(AccountSid,AuthToken);
twilio.SendSmsMessage(twilioPhoneNumber,message.Destination,message.Body);
public class SmsService : IIdentityMessageService { public Task SendAsync(IdentityMessage message) { string AccountSid = "myAccountSID"; string AuthToken = "myAuthToken"; string twilioPhoneNumber = "MyTwilioPhoneNumber"; var twilio = new TwilioRestClient(AccountSid, AuthToken); twilio.SendSmsMessage(twilioPhoneNumber, message.Destination, message.Body);
// **** TwilioRestClient不包含SendSmsMessage的定义*****
//****TwilioRestClient does not contain a definition for SendSmsMessage*****
返回Task.FromResult(0);
}
}
return Task.FromResult(0); } }
推荐答案
如果Go To Definition不起作用,那么函数名称不是有效。再次输入客户名称并加上一个点,您应该获得可用成员的智能感知。
If Go To Definition doesn't work then the function name isn't valid. Type the client name again and put a dot and you should get Intellisense for the available members.
这篇关于'TwilioRestClient'不包含'SendSmsMessage'的定义,也没有找到接受第一个类型'TwilioRestClient'的扩展方法'SendSmsMessage'。请帮忙!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!