public WatsonToneAnalyzer(string apiKey, string serviceUrl, SaraDbContext db) { IamAuthenticator authenticator = new IamAuthenticator(apikey: apiKey); ToneAnalyzer = new ToneAnalyzerService("2017-09-21", authenticator); ToneAnalyzer.SetServiceUrl(serviceUrl); SaraDbContext = db; }
public static void Main(string[] args) { var db = SaraDbContext.CreateContextToLocalDb(); db.Database.EnsureDeleted(); db.Database.Migrate(); db.SeedData(); var apiKey = ConfigurationManager.AppSettings["WatsonToneAnalyzerApiKey"]; var url = ConfigurationManager.AppSettings["WatsonToneAnalyzerUrl"]; Console.WriteLine($"Connecting to Watson Tone Analyzer using api key: {apiKey} and url {url}"); WatsonToneAnalyzer analyzer = new WatsonToneAnalyzer(apiKey, url, db); analyzer.ProcessMessages(); }
/// <summary> /// Initializes a new instance of the <see cref="CustomerRepository"/> class. /// </summary> /// <param name="context">The context.</param> public CustomerRepository(SaraDbContext context) : base(context) { }
/// <summary> /// Initializes a new instance of the <see cref="StateRepository"/> class. /// </summary> /// <param name="context">The context.</param> public StateRepository(SaraDbContext context) : base(context) { }
/// <summary> /// Initializes a new instance of the <see cref="AddressRepository"/> class. /// </summary> /// <param name="context">The context.</param> public AddressRepository(SaraDbContext context) : base(context) { }