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;
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerRepository"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public CustomerRepository(SaraDbContext context) : base(context)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StateRepository"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public StateRepository(SaraDbContext context) : base(context)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AddressRepository"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 public AddressRepository(SaraDbContext context) : base(context)
 {
 }