Skip to content

Commit

Permalink
storing all quote data in the CurrentQuery object works.
Browse files Browse the repository at this point in the history
  • Loading branch information
lavedon committed Apr 19, 2021
1 parent 85eac0b commit bfdafa1
Show file tree
Hide file tree
Showing 14 changed files with 240 additions and 3 deletions.
10 changes: 9 additions & 1 deletion API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,15 @@ public static void APICalls(CurrentQuery query)
// Get what year the quote is from
JsonElement quoteYear = item.GetProperty("year");
Console.WriteLine("\"{0}\", Year: {1}, Source: {2} {3}",
actualQuote.ToString(), quoteYear.ToString(), quoteAuthor.ToString(), quoteTitle.ToString());
actualQuote.ToString(), quoteYear.ToString(), quoteAuthor.ToString(),
quoteTitle.ToString());
Quote currentQuote = new();
currentQuote.Year = quoteYear.GetInt16();
currentQuote.Text = actualQuote.ToString();
currentQuote.Title = quoteTitle.ToString();
currentQuote.Author = quoteAuthor.ToString();

query.Quotes.Add(currentQuote);
Console.WriteLine();
Console.WriteLine("----Enter for more - X to exit----");
string input = Console.ReadLine().Trim().ToLower();
Expand Down
5 changes: 4 additions & 1 deletion CurrentQuery.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;

namespace OxfordV2
{
Expand All @@ -22,7 +23,7 @@ class CurrentQuery : IDisposable
public string Lamma { get; set; }
public int NumberOfQuotes { get; set; }
public string Quote { get; set; }
public string[] Quotes { get; set; }
public List<Quote> Quotes { get; set; }

public string EtymologySummary { get; set; }
public string FirstUse { get; set; }
Expand All @@ -32,7 +33,9 @@ class CurrentQuery : IDisposable

public CurrentQuery() {
this.HasLookedUpWord = false;
this.Quotes = new List<Quote>();
}
public string? Source { get; set; }

public void Dispose ()
{
Expand Down
14 changes: 14 additions & 0 deletions Quote.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace OxfordV2
{
public class Quote
{
public int? Year { get; set; }
public string? Text { get; set; }
public string? Title { get; set; }
public string? Author { get; set; }

}



}
Binary file modified bin/Debug/net5.0/OxfordV2.dll
Binary file not shown.
Binary file modified bin/Debug/net5.0/OxfordV2.pdb
Binary file not shown.
Binary file modified bin/Debug/net5.0/ref/OxfordV2.dll
Binary file not shown.
53 changes: 53 additions & 0 deletions logs/Log_OxfordApplication_20210419-1651.txt

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions logs/Log_OxfordApplication_20210419-1653.txt

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions logs/Log_OxfordApplication_20210419-1657.txt

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions logs/Log_OxfordApplication_20210419-1704.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion obj/Debug/net5.0/OxfordV2.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
03eec22c09a93071a7f2cf06ecb26f26211813ed
bdf1676f11f0431813dde50f3e46290763023230
Binary file modified obj/Debug/net5.0/OxfordV2.dll
Binary file not shown.
Binary file modified obj/Debug/net5.0/OxfordV2.pdb
Binary file not shown.
Binary file modified obj/Debug/net5.0/ref/OxfordV2.dll
Binary file not shown.

0 comments on commit bfdafa1

Please sign in to comment.