public void WithDataResult() { var config = ConfigHelper.GetConfig(); var smtp = new SmtpClient( config["SendGrid:Server"], int.Parse(config["SendGrid:Port"])); smtp.Credentials = new NetworkCredential("apikey", config["SendGrid:ApiKey"]); var querySource = new QuerySource("*****@*****.**", LocalDb.GetConnectionString(DbName)) { Queries = new Query[] { SampleQuery() } }; var service = new SqlQueryNotificationService(smtp, querySource, null); service.ExecuteAsync().Wait(); }
public void BlobDataResult() { var config = ConfigHelper.GetConfig(); var smtp = new SmtpClient( config["SendGrid:Server"], int.Parse(config["SendGrid:Port"])); smtp.Credentials = new NetworkCredential("apikey", config["SendGrid:ApiKey"]); var querySource = new BlobQuerySource( config["Azure:ConnectionString"], LocalDb.GetConnectionString(DbName), "*****@*****.**", config["Azure:ContainerName"], config["Azure:BlobPrefix"]); CreateSampleQueryBlob(config); var service = new SqlQueryNotificationService(smtp, querySource, null); service.ExecuteAsync().Wait(); }