コード例 #1
0
        public InjectOptions()
        {
            var appSettings = new ConfigurationBuilder()
                              .AddJsonFile("appsettings.json", true, true)
                              .Build();

            Authentication      = new Authentication(appSettings["AppSettings:Username"], appSettings["AppSettings:Password"]);
            GenerateQueryString = new GenerateQueryString();
            GenerateUrl         = new GenerateUrl(appSettings["AppSettings:SmsGateway"]);

            SmsRequest = new SmsRequest(appSettings["AppSettings:ReponseType"], appSettings["AppSettings:MockMode"])
            {
                GenerateUrl    = GenerateUrl,
                Authentication = Authentication
            };

            SmsLogger = new SmsLogger();
        }
コード例 #2
0
        public static string Go()
        {
            var body = new List <SmsModel>
            {
                new SmsModel()
                {
                    Message = "this is a test message", Number = "0831111111"
                },
                new SmsModel()
                {
                    Message = "and this is another test", Number = "0831111111"
                }
            };
            var obj = new GenerateQueryString
            {
                SmsModel = body
            };

            return(obj.ForSend());
        }